writeAnimation
Save animation as video file
Syntax
Description
writeAnimation( writes animation
objects in the current figure to a GIF or AVI video file. The animation objects must be
created using the filename)fanimator
function. The extension of filename sets the video format, and must be
either '.gif' or '.avi'.
If you do not specify the file extension, then
writeAnimationchooses the'.avi'extension by default.If you specify any other file extension, such as
'.mp4'or'.mpg', thenwriteAnimationreturns an error message.
writeAnimation(___,
writes animation objects with the specified Name,Value)Name,Value pair arguments.
Use this option with any of the input argument combinations in the previous syntaxes. You
can set the name-value pair settings to specify the properties of a GIF or AVI video
file.
writeAnimation( writes animation
objects in the current figure to a vidObj)VideoWriter object. This syntax provides the option to save animation
objects in another video file format, such as 'MPEG-4' or
'Uncompressed AVI'.
writeAnimation(
writes animation objects in the figure fig,vidObj)fig to a VideoWriter object.
If you save an animation as a VideoWriter object, then the properties of the output video file follow the
properties of the VideoWriter object.
Examples
Input Arguments
Name-Value Arguments
Version History
Introduced in R2019a
See Also
fanimator | animationToFrame | playAnimation | rewindAnimation | VideoWriter

