Allocate matrix for movie frames
Syntax
M = moviein(n)
M = moviein(n,h)
M = moviein(n,h,rect)
Description
moviein
allocates an appropriately sized matrix for the getframe function.
M = moviein(n)
creates matrix M having n columns to store n frames of a movie based on the size of the current Axes.
M = moviein(n,h)
specifies a handle for a valid Figure or Axes graphics object on which to base the memory requirement. You must use the same handle with getframe. If you want to capture the axis
M = moviein(n,h,rect)
specifies the rectangular area from which to copy the bitmap, relative to the lower-left corner of the Figure or Axes graphics object identified by h. rect = [left bottom width height], where left and bottom specify the lower-left corner of the rectangle, and width and height specify the dimensions of the rectangle. Components of rect are in pixel units. You must use the same handle and rectangle with getframe.
Examples
Use moviein to allocate a matrix for the movie frames and getframe to create the movie:
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, movie
[ Previous | Help Desk | Next ]