Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matlab GUI: changing multiple lines static text

  1. Apr 6, 2010 #1
    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 (Text):

    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?
  2. jcsd
  3. Apr 14, 2010 #2


    User Avatar
    Science Advisor
    Gold Member

    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.


    Code (Text):
    A={'blah blah whatever'};
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook