M-File Help: Animate View code for Animate

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.

Example

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

Animate.Animate

Create an animation class

a = ANIMATE(name, options) initializes an animation, and creates a folder called name to hold the individual frames.

Options

'resolution', R Set the resolution of the saved image to R pixels per

inch.


Animate.add

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.

See also

print


 

© 1990-2014 Peter Corke.