Вы можете использовать avifile
для создания фильма или даже более новый VideoWriter
:
AVIFile
Z = peaks; surf(Z);
axis tight
set(gca,'nextplot','replacechildren');
vid = avifile('myPeaks.avi', 'fps',15, 'quality',100);
for k = 1:20
surf(sin(2*pi*k/20)*Z,Z)
vid = addframe(vid, getframe(gcf));
end
vid = close(vid);
winopen('myPeaks.avi')
VideoWriter
Z = peaks; surf(Z);
axis tight
set(gca,'nextplot','replacechildren');
vid = VideoWriter('myPeaks2.avi');
vid.Quality = 100;
vid.FrameRate = 15;
open(vid);
for k = 1:20
surf(sin(2*pi*k/20)*Z,Z)
writeVideo(vid, getframe(gcf));
end
close(vid);
winopen('myPeaks2.avi')