フィルターのクリア

save animation in subplot

13 ビュー (過去 30 日間)
feynman feynman
feynman feynman 2024 年 8 月 15 日 22:09
回答済み: Walter Roberson 2024 年 8 月 16 日 1:14
I'm using
while
drawnow;hold off
end
to create an animation. But this animation is just the 6th position as in subplot(2,3,6) (or through next tile repeatedly). To save this animation to the computer while not keeping the other subplots 1~5, what to do?
  1 件のコメント
Walter Roberson
Walter Roberson 2024 年 8 月 16 日 1:11
??
That is an infinite loop. Inside the infinite loop, you request that the graphics queue be flushed, and you turn off hold . But you do not do anything else -- no drawing at all, no recording of previously drawn material.
It is not clear what you are trying to do?

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

回答 (1 件)

Walter Roberson
Walter Roberson 2024 年 8 月 16 日 1:14
ax6 = subplot(2,3,6);
count = 0;
while true
%draw something
count = count + 1;
filename = fullfile(SAVEDIRECTORY, "image" + count + ".png");
exportgraphics(ax6, filename);
end

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by