How can I store video of my for loop code?

Hello, I am beginner for Matlab and use Matlab 2014a.
I made my code which is consisted of for loop statement.
So I want to store the variation of my plot into the avi file.
Could you help me?

댓글 수: 1

Hi!
Share what you have tried to write as code as well as the plots you want to 'store' as an avi .
Thanks

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

 채택된 답변

Abderrahim. B
Abderrahim. B 2022년 8월 28일

0 개 추천

I ve written the below code that you can refer to.
clear
t = 0:1/100:1-1/100;
vObj = VideoWriter('AnimPPlot.avi');
open(vObj);
for ii = 1:length(t)
plot(t, exp(-ii*t))
pltHandle = gcf ;
im = frame2im(getframe( pltHandle )) ;
writeVideo(vObj, im); % Write avi video
end
close(vObj)
Hope this helps

댓글 수: 2

J Kwon
J Kwon 2022년 8월 28일
Thank you for your kindness Issa!
I accoplished my problem thanks to you.
You are welcome!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품

릴리스

R2014a

질문:

2022년 8월 28일

댓글:

2022년 8월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by