# movie

## Purpose

Play recorded movie frames.

## Synopsis

    movie(M)
    movie(M,n)
    movie(M,n,fps)
    movie(h,...)
    movie(h,m,n,fps,loc)

## Description

`movie(M)` plays the movie in matrix `M` once. `M` must be a matrix whose columns are movie frames (usually from `getframe`).

`movie(M,n)` plays the movie `n` times. If `n` is negative, each play is once forward and once backward. If `n` is a vector, elements 2 and above specify the order in which to play the frames. For example, if `M` has three columns, `n = [10 3 2 1]` plays the movie 10 times backwards.

`movie(M,n,fps)` plays the movie at `fps` frames per second. The default if `fps` is omitted is 12 frames per second. Machines that can't achieve the specified `fps` play as fast as they can.

`movie(h,...)` plays the movie in object `h`, where `h` is a handle to a figure or an axes.

`movie(h,m,n,fps,loc)` specifies the location `loc` to play the movie, relative to the lower-left corner of object `h` and in the units of its `Units` property. `loc` is a four-element vector, `loc = [x y 0 0]`. Note that the first two elements of `loc` specify the location of the lower-left corner of the movie; the last two elements are not used, but must be present.

## Examples

Make the `peaks` function vibrate:

    z = peaks;
    surf(z);
    lim = axis;
    M = moviein(20);
    for j = 1:20 % Record the movie
        surf(sin(2*pi*j/20)*z,z)
        axis(lim)
        M(:,j) = getframe;
    end
    movie(M,20) % Play the movie twenty times

## See Also

    getframe, moviein

(c) Copyright 1994 by The MathWorks, Inc.