how to display command window results in a GUI or a figure

i have big program which shows a figure with graph and also print out some data in the command window (like, the number of cars in this city is 345) and (temperature = 20c). i want to display that written information in command window that we get when we run the program into a textbox like a figure almost that pops up when you run the script.
also it would be great if i can kind of subplot that information with the graph i have , like in figure(1) the top could be graph and under it all the information written that we get from the command window.

Respuestas (1)

You can use sprintf() to create a string with your resuls. Then use helpdlg() to display it whenever you want:
message = sprintf('The number is %f', yourResult);
uiwait(helpdlg(message));
To display in a graph on your GUI, create your message as above, then use text() to place it in your graph:
text(x, y, message, 'FontSize', 20, 'FontWeight', 'bold');

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Preguntada:

el 30 de Nov. de 2016

Respondida:

el 30 de Nov. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by