The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: add new string to listbox
Replies: 2   Last Post: Nov 17, 2011 4:20 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Walter Roberson

Posts: 7,678
Registered: 1/20/06
Re: add new string to listbox
Posted: Mar 25, 2011 11:58 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 25/03/11 8:21 PM, zheng chew wrote:

> How can I add new strings into a listbox?
> By using \n doesn't seem to do the job.
> I tried:
> initial_name=get(handles.listbox,'String')
> new_name = sprintf('%s\n%s',initial_name,new_line) % assume there is a
> string store in variable new_line
> set(handles.listbox,'String',new_name) gives the new_line and
> initial_line on the same line.

new_name = [initial_name;{new_line}];

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.