making a movie from plots
Show older comments
I am making an animation using a loop and the pause() function, and I want to save the entire animation to make a movie. The plot, as I understand, continuously refreshes to make an animation.
How can I do this?
Answers (2)
Walter Roberson
on 18 Nov 2015
0 votes
3 Comments
Tanziha Mahjabin
on 17 Feb 2020
Hi,
i have already saved figures in a folder. how can i make a gif in matlab combining all of them?
Hussein
on 8 Jul 2023
Please try this
Hussein
on 8 Jul 2023
clc clear all close all Z = peaks; surf(Z) axis tight set(gca,'nextplot','replacechildren','visible','off') f = getframe; [im,map] = rgb2ind(f.cdata,256,'nodither'); im(1,1,1,20) = 0; for k = 1:20 surf(cos(2*pi*k/20)*Z,Z) f = getframe; im(:,:,1,k) = rgb2ind(f.cdata,map,'nodither'); end imwrite(im,map,'DancingPeaks.gif','DelayTime',0.1,'LoopCount',inf) %g443800
Image Analyst
on 8 Jul 2023
0 votes
See attached demos, especially movie_made_from_plot.m.
Categories
Find more on Animation 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!