Breaking up strings in Matlab

Hello! I would like to know if there is a way to break up a long (very long--several sentences) string into several lines? In my program, I need to use an input command which contains a question for the user. But I need to make it look presentable and I don't want the user to have to scroll the page. Is there a way to do that? I know that the '...' command doesn't work for strings.
Thank you very much!!


  • Try this approach:

    s1 = 'string 1 ';
    s2 = 'string 2';
    s3 = 'string 3';
    s4 = [s1 s2 s3 ' '];

    i1 = input(s1, 's');
    i2 = input(s4, 's');
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion