I want to make a movie from plots in MATLAB. How do I do this?

3 ビュー (過去 30 日間)
Kalamaya
Kalamaya 2012 年 5 月 18 日
回答済み: Image Analyst 2023 年 7 月 8 日
Hi there,
I would like to make a movie from MATLAB plots that are plotted on a figure. (It does not have to be real time - can post process no problem). I would like to know how to:
  • Make an animated gif from plots.
  • Make an mpeg from plots.
How can I go about doing this? Is there a way? Thanks!

回答 (3 件)

bym
bym 2012 年 5 月 18 日

Hussein
Hussein 2023 年 7 月 8 日
編集済み: Walter Roberson 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,'LoopCount',inf)
%g443800

Image Analyst
Image Analyst 2023 年 7 月 8 日

カテゴリ

Help Center および File ExchangeAnimation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by