GUI: Creating instructions page.

1 visualización (últimos 30 días)
Kartavya
Kartavya el 6 de Mayo de 2014
Respondida: Image Analyst el 7 de Mayo de 2014
Hi, I have a push button in matlab GUI and when that is used, I want to open up a simple text window with instructions in it.
I"m currently experimenting with msgbox but I can't seem to make text appear in new line.

Respuestas (1)

Image Analyst
Image Analyst el 7 de Mayo de 2014
You can do it two ways:
theValue = 42;
% Method 1 (my favorite): use sprintf with \n.
message = sprintf('Line 1\nLine 2, the value = %d\nLine 3', theValue);
uiwait(msgbox(message));
% Mathod #2: use cell array:
message = {'Line 1', ['Line 2, the value = ', num2str(theValue)], 'Line 3'};
uiwait(helpdlg(message));

Categorías

Más información sobre Programming en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by