save animation in subplot

조회 수: 21 (최근 30일)
feynman feynman
feynman feynman 2024년 8월 15일
댓글: feynman feynman 대략 4시간 전
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?
  댓글 수: 2
Walter Roberson
Walter Roberson 2024년 8월 16일
??
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?
feynman feynman
feynman feynman 2024년 11월 14일 5:03
thanks for your answer. I omitted '%draw something' as in your code

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2024년 8월 16일
ax6 = subplot(2,3,6);
count = 0;
while true
%draw something
count = count + 1;
filename = fullfile(SAVEDIRECTORY, "image" + count + ".png");
exportgraphics(ax6, filename);
end
  댓글 수: 8
Walter Roberson
Walter Roberson 대략 10시간 전
subplot24=subplot(2,2,[2;4]);
%...
subplot2=subplot(2,2,2);
subplot24 is expected to be about twice the size of subplot2 . You will have trouble writing both of them to the same video, unless you imresize() to a common size.
feynman feynman
feynman feynman 대략 3시간 전
amazing, thanks so much!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Animation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by