getframe with hold on plotting all previous frames

5 次查看(过去 30 天)
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

采纳的回答

ALEX
ALEX 2015-3-10
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);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Performance 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by