Insert text to the image in for loop
9 views (last 30 days)
Show older comments
Hi,
I am trying to insert text to the series of images being generated for each iteration in for loop. For instance, lets say for f = 1:1:200, at f = 1 ieration i need to insert text of t = 0 s likewise t = 0.0002 s, t = 0.0004 s, t = 0.0006s for f = 2, 3, 4 ans so on respectively..
Please help me with this..
Accepted Answer
Rik
on 14 May 2021
Edited: Rik
on 14 May 2021
Instead of recreating graphics object every iteration of your loop, it is often faster to create the object once and then update the properties:
text_handle=text(25,-35,'');
for g = 0:0.00002:0.04
text_handle.String=sprintf('t= %.5f',g);
drawnow % force graphics update
end
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!