Long Char Statements Using Various dlg() Commands

2 views (last 30 days)
I'm trying to keep the same string of text going onto the next line in my .m file but it cuts it off. I attempted to use the ' ... ' method
This is what I have now and it works fine,
errordlg('Number not found in array. Or you may have not entered a number. Program terminating.',...
'File Error');
but I want the text:
'Number not found in array. Or you may have not entered a number. Program terminating.'
split up in the middle to the next line of the .m file to make the code easier to read, ie. I don't have to scroll to the right in the file to read the whole text. I am having trouble figuring out how to make the same string of text continue to the next line and still be within the same quotes as the previous line.

Accepted Answer

Matt J
Matt J on 12 Jul 2013
Edited: Matt J on 12 Jul 2013
There might be better ways, but this does work:
msg=['Number not found in array. Or you may have ',...
'not entered a number. Program terminating.'];
errordlg(msg, 'File Error');

More Answers (1)

JP
JP on 12 Jul 2013
Elegant. Thanks.

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!