フィルターのクリア

create a gif or video using this sequence of figures

86 ビュー (過去 30 日間)
Alberto Acri
Alberto Acri 2020 年 12 月 26 日
コメント済み: Walter Roberson 2020 年 12 月 29 日
I want to create a gif or video using this sequence of figures:
plot of figure 1
pause(0.8);
hold on;
plot of figure 2;
pause(0.8);
plot of figure 3;
pause(0.8);
plot of figure 4;
pause(0.8);
hold off
Is it possible ?
  7 件のコメント
Alberto Acri
Alberto Acri 2020 年 12 月 27 日
but I want to create a video with the sequence of images above.
Walter Roberson
Walter Roberson 2020 年 12 月 27 日
Your question asked to create a gif or a video, and the above shows creating a gif.

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

回答 (1 件)

Gaurav Garg
Gaurav Garg 2020 年 12 月 29 日
Hi,
Apart from all the resources provided in the comments above, the below links would surely help you -
1.) Link 1
2.) Link 2
The above 2 links contain similar questions answered by MATLAB users and accepted too.
  2 件のコメント
Alberto Acri
Alberto Acri 2020 年 12 月 29 日
I used link 1 shown below:
N=1 % set
for i = 1:N
figure(1)
% imshow(processo(:,:,1,i))
plot of figure 1
pause(0.8);
hold on;
plot of figure 2;
pause(0.8);
plot of figure 3;
pause(0.8);
plot of figure 4;
pause(0.8);
hold off
F(i) = getframe(gcf) ;
drawnow
end
% create the video writer with 1 fps
writerObj = VideoWriter('myVideo.avi');
writerObj.FrameRate = 10;
% set the seconds per image
% open the video writer
open(writerObj);
% write the frames to the video
for i=1:length(F)
% convert the image to a frame
frame = F(i) ;
writeVideo(writerObj, frame);
end
% close the writer object
close(writerObj);
but it creates me a video of 00.00.00 seconds. I set N=1
Walter Roberson
Walter Roberson 2020 年 12 月 29 日
You need more than one frame for avi files. It is a limitation of the movie encoders.

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

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by