Thread Closed

Matlab GUI: changing multiple lines static text

 
Share Thread Thread Tools
Apr6-10, 04:42 AM   #1
 

Matlab GUI: changing multiple lines static text


hi,
I'm ran into a problem while creating a Matlab GUI and I can't seem to find out why.
I'm trying to get multiple lines in one static text. I set the 'max' property on 12 and then wrote the following code to test:

Code:
A='a';B='b';C='c';D='d';E='e';F='f';G='g';H='h';I='i';J='j';K='k';L='l';
        
set(handles.text1,'String',[A;B;C;D;E;F;G;H;I;J;K;L]);
that seems to work fine, but when I change A to for example 'this is a test', I get an error saying there's something wrong with my set instruction.
I can't seem to be able to display more than one letter for each string.
Can anyone help me with this?
 
PhysOrg.com
PhysOrg
science news on PhysOrg.com

>> Front-row seats to climate change
>> Attacking MRSA with metals from antibacterial clays
>> New formula invented for microscope viewing, substitutes for federally controlled drug
Apr14-10, 10:32 PM   #2
 
Recognitions:
Gold Membership Gold Member
Science Advisor Science Advisor
Try setting all of your elements as cells (with the braces) so that you end up with a cell array of strings rather than a character array - your error may have something to do with that because with a character array, if A,B,C, etc. cannot have a different number of elements.

e.g.:

Code:
A={'blah blah whatever'};
 
Thread Closed
Thread Tools


Similar Threads for: Matlab GUI: changing multiple lines static text
Thread Forum Replies
cant understand those lines in a text about solid state physics Electrical Engineering 5
Changing the variable in multiple integrals Calculus & Beyond Homework 3
Matlab: How to plot 'text' Math & Science Software 1
Wrapping multiple figures with text in latex Math & Science Software 2
Extra text lines Forum Feedback & Announcements 6