Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Write on next line whilst constructing questdlg

Asked by Louis Vallance on 16 Jan 2013

Hey guys,

I'm constructing a question dialog box which has quite a lot of writing in it. Is there a way of writing the rest of the text on the next line of the script file? I've tried using ellipses and it's not working.

On a side note, is it possible to format questdlg so that you can split the dialog text into separate paragraphs?


Louis Vallance




No products are associated with this question.

1 Answer

Answer by Jan Simon

Jan Simon (view profile)

on 16 Jan 2013
Edited by Jan Simon

Jan Simon (view profile)

on 18 Jan 2013
Accepted answer

QUESTDLG wraps the text automatically at a certain width. Several paragraphs can be obtained by using a cell string, perhaps with an empty string as separator:

Str = ['asdhgaiosdzgoaszdlbas l lashb kjha sd,man bsdljhakshdg v ', ...
       'öaiosuh asödh ljhansbd kjash dbkashdg'];
questdlg({Str, '', Str})

Look at the doc textwrap command also.

[EDITED, Jan, typo fixed: quote character inserted]


Louis Vallance on 17 Jan 2013

Thanks for the reply.

If I use your code as an example and execute I get the following error:

??? Undefined function or variable 'ljhansbd kjash dbkashdg'.

I've never had much luck with using "..." to separate strings.

Jan Simon

Jan Simon (view profile)

on 18 Jan 2013

Yes, Louis, I forgot a quote character. Could you be able to fix this by your own?

Jan Simon

Jan Simon (view profile)

Contact us