필터 지우기
필터 지우기

getframe with hold on plotting all previous frames

조회 수: 5 (최근 30일)
ALEX
ALEX 2015년 3월 10일
댓글: Tomaz Plavcak 2021년 5월 26일
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