How can i display a variable in the figure
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
Answers (3)
Adam
on 23 Nov 2014
Use a uicontrol with 'Style' 'text' and set the 'String' property to num2str( variableName ).
doc uicontrol
Hanna Buitenhuis
on 16 Oct 2018
1 vote
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));
Categories
Find more on App Building 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!