Play recorded movie frames
Syntax
movie(M)
movie(M,n)
movie(M,n,fps)
movie(h,...)
movie(h,M,n,fps,loc)
Description
movie
plays the movie defined by a matrix whose columns are movie frames (usually produced by getframe
).
movie(M)
plays the movie in matrix M
once.
movie(M,n)
plays the movie n
times. If n
is negative, each cycle is shown forward then backward. If n
is a vector, the first element is the number of times the movie is played, and the second through last elements specify the order in which to play the frames. For example, if M
has three columns, n = [10 3 2 1]
plays the movie backwards 10 times.
movie(M,n,fps)
plays the movie at fps
frames per second. The default is 12 frames per second. Computers that cannot achieve the specified speed play as fast as possible.
movie(h,...)
plays the movie in the Figure or Axes identified by h
.
movie(h,M,n,fps,loc)
specifies a four-element location vector, [x y 0 0]
, where the lower-left corner of the movie frame is anchored (only the first two elements in the vector are used). The location is relative to the lower-left corner of the Figure or Axes specified by handle
and in units of pixels, regardless of the object's Units
property.
Remarks
The movie
function displays each frame as it loads the data into memory, and then plays the movie. This eliminates long delays with a blank screen when you load a memory-intensive movie. The movie's load cycle is not considered one of the movie repetitions.
Examples
Animate the peaks
function as you scale the values of Z
:
Z =
peaks;
surf(Z);
M
=
moviein(20);
%
Freeze Axes limits
axis manual
set(gca,'nextplot','replacechildren');
%
Record
the
movie
for
j
=
1:20
surf(sin(2*pi*j/20)*Z,Z)
M(:,j)
=
getframe;
end
%
Play
the
movie
twenty
times
movie(M,20)
See Also
getframe
, moviein
[ Previous | Help Desk | Next ]