How can I store video of my for loop code?
14 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
J Kwon am 28 Aug. 2022
Kommentiert: Abderrahim. B am 28 Aug. 2022
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?
Share what you have tried to write as code as well as the plots you want to 'store' as an avi .
I ve written the below code that you can refer to.
t = 0:1/100:1-1/100;
vObj = VideoWriter('AnimPPlot.avi');
for ii = 1:length(t)
pltHandle = gcf ;
im = frame2im(getframe( pltHandle )) ;
writeVideo(vObj, im); % Write avi video
Hope this helps
Weitere Antworten (0)
Find more on Video Formats and Interfaces in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!