Filter löschen
Filter löschen

getframe with hold on plotting all previous frames

5 Ansichten (letzte 30 Tage)
ALEX
ALEX am 10 Mär. 2015
Kommentiert: Tomaz Plavcak am 26 Mai 2021
I am trying to make an animation of some data from a lab experiment. I need to use the hold on command so that the outline of our test subject and the information from other sets of data is saved onto the plot. The problem is when I use hold on and hold off, everything from previous frames gets plotted. This seems like such a basic problem but I can't find any information related to it.
Thanks for you help, Alex

Akzeptierte Antwort

ALEX
ALEX am 10 Mär. 2015
ALEX,
I think you need to use the delete function after each frame
hold on
p1=plot(loc1(1)+xp,loc1(2)+yp,'r') p2=plot(loc2(1)+xp,loc2(2)+yp,'r') p3=plot(loc3(1)+xp,loc3(2)+yp,'r') p4=plot(loc4(1)+xp,loc4(2)+yp,'r')
plot(prism(:,1),prism(:,2)); axis('tight') hold off
frame = getframe(h); writeVideo(writerObj,frame)
delete(p1); delete(p2); delete(p3); delete(p4);

Weitere Antworten (0)

Kategorien

Mehr zu Graphics Performance finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by