Breaking up strings in Matlab - Programmers Heaven

Howdy, Stranger!

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


Breaking up strings in Matlab

johnjoe2010johnjoe2010 Posts: 1Member
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!!


  • jjasso5jjasso5 Posts: 41Member
    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.