making a movie from plots

136 次查看(过去 30 天)
cgo
cgo 2015-11-18
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?

回答(2 个)

Walter Roberson
Walter Roberson 2015-11-18
  3 个评论
Hussein
Hussein 2023-7-8
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
Image Analyst 2023-7-8

类别

Help CenterFile Exchange 中查找有关 Animation 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by