M-File Help: Animate | View code for Animate |
Create an animation
Helper class for creating animations. Saves snapshots of a figture as a folder of individual PNG format frames numbered 0000.png, 0001.png and so on.
anim = Animate('movie');
for i=1:100
plot(...); anim.add();
end
To convert the image files to a movie you could use a tool like ffmpeg
% ffmpeg -r 10 -i movie/*.png out.mp4
Create an animation class
a = ANIMATE(name, options) initializes an animation, and creates a folder called name to hold the individual frames.
'resolution', R | Set the resolution of the saved image to R pixels per |
inch.
Adds current plot to the animation
A.ADD() adds the current figure in PNG format to the animation folder with a unique sequential filename.
A.ADD(fig) as above but captures the figure fig.
© 1990-2014 Peter Corke.