23.12.2012 Views

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

addframe<br />

2addframe<br />

Purpose Add a frame to an Audio Video Interleaved (AVI) file.<br />

Syntax aviobj = addframe(aviobj,frame)<br />

aviobj = addframe(aviobj,frame1,frame2,frame3,...)<br />

aviobj = addframe(aviobj,mov)<br />

aviobj = addframe(aviobj,h)<br />

Description aviobj = addframe(aviobj,frame) appends the data in frame to the AVI file<br />

identified by aviobj, which was created by a previous call to avifile. frame<br />

can be either an indexed image (m-by-n) or a truecolor image (m-by-n-by-3) of<br />

double or uint8 precision. If frame is not the first frame added to the AVI file,<br />

it must be consistent with the dimensions of the previous frames.<br />

2-38<br />

addframe returns a handle to the updated AVI file object, aviobj. For example,<br />

addframe updates the TotalFrames property of the AVI file object each time it<br />

adds a frame to the AVI file.<br />

aviobj = addframe(aviobj,frame1,frame2,frame3,...) adds multiple<br />

frames to an AVI file.<br />

aviobj = addframe(aviobj,mov) appends the frame(s) contained in the<br />

<strong>MATLAB</strong> movie, mov, to the AVI file, aviobj. <strong>MATLAB</strong> movies that store<br />

frames as indexed images use the colormap in the first frame as the colormap<br />

for the AVI file, unless the colormap has been previously set.<br />

aviobj = addframe(aviobj,h) captures a frame from the figure or axis handle<br />

h, and appends this frame to the AVI file. addframe renders the figure into an<br />

offscreen array before appending it to the AVI file. This ensures that the figure<br />

is written correctly to the AVI file even if the figure is obscured on the screen<br />

by another window or screen saver.<br />

Note If an animation uses XOR graphics, you must use getframe to capture<br />

the graphics into a frame of a <strong>MATLAB</strong> movie. You can then add the frame to<br />

an AVI movie using the addframe syntax, aviobj = addframe(aviobj,mov).<br />

See the example for an illustration.<br />

Example This example calls addframe to add frames to the AVI file object, aviobj.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!