How can we add different lines in msgbox with different lengths?

5 views (last 30 days)
How can we add different lines in msgbox with different lengths? We cant use () these brackets neither brackets used in cell array so what is the option?

Accepted Answer

Image Analyst
Image Analyst on 13 Dec 2014
Use sprintf and \n. For example:
message = sprintf('This is line 1.\nThe date is %s', date)
msgbox(message);

More Answers (0)

Categories

Find more on Dialog Boxes in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!