How to create a textbox with a changing variable?
显示 更早的评论
I have a code which runs a movie using drawnow (not my own code, just adding stuff to it) and I would like to add a text box which indicates the frame number as the movie is playing.
I can get it to work with the 'annotation' function and using num2str but it seems like the numbers are overwritten on top of each other like in the file.
Curiously, when I try it using the title:
title(['i = ' num2str(i)])
it works fine
3 个评论
Rik
2018-7-8
And your inputs are correct? You didn't show the code that doesn't work, only the result, so there is no way to debug your code, except guessing, which is a bad strategy.
Robert U
2018-7-9
Hi AbdullahAJ6:
It looks like you are creating new annotations every loop iteration. If so, create an annnotation object of your annotation and modify the "String" property.
Kind regards,
Robert
AbdullahAJ6
2018-7-14
编辑:AbdullahAJ6
2018-7-14
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Spline Postprocessing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!