フィルターのクリア

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);
  1 件のコメント
Tomaz Plavcak
Tomaz Plavcak 2021 年 5 月 26 日
thank you that was very helpfull

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Performance についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by