how to display command window results in a GUI or a figure
7 views (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
Image Analyst
on 30 Nov 2016
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');
0 Comments
See Also
Categories
Find more on Subplots 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!