How can i display a variable in the figure
7 views (last 30 days)
Show older comments
how can i display in a figure a variable..
something like:
your score is %d, score
when score can get different values.
Thanks
0 Comments
Answers (3)
Adam
on 23 Nov 2014
Use a uicontrol with 'Style' 'text' and set the 'String' property to num2str( variableName ).
doc uicontrol
0 Comments
Hanna Buitenhuis
on 16 Oct 2018
Hi! this worked for mine as well but it displays it right after the click. How can I make it that it displays at the end of a game I made?
1 Comment
Image Analyst
on 16 Oct 2018
What worked? Whose post should your "Answer" have been a comment to: me, Adam, or oMRi? Plus, even if it were for me, I have no idea how to answer. Just put the code at the end of your game code.
Image Analyst
on 23 Nov 2014
message = sprintf('Your score is %d.', score);
uiwait(helpdlg(message));
0 Comments
See Also
Categories
Find more on Migrate GUIDE Apps 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!