I am using plot. And I want to save my continuously changing plot in time loop. I have applied this code but error is coming regarding the frame rates. Please help.

조회 수: 3 (최근 30일)
%Initialize video
myVideo = VideoWriter('myVideoFile'); %open video file
myVideo.FrameRate = 6; %can adjust this, 5 - 10 works well for me
open(myVideo)
for t=0:dt:T
% something happening here
plot(hnew)
ylim([0,6.5])
pause(0.1)
frame = getframe(gcf); %get frame
writeVideo(myVideo, frame);
end
close(myVideo)
  댓글 수: 1
Suvansh Arora
Suvansh Arora 2022년 12월 2일
In order to understand this better, I would need your help with the following information:
  1. 'MAT' file that contains value of 'hnew'.
  2. The exact error messages you are receiving, if any.
  3. How can I reproduce this issue at my end.

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

답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by