% SHOWMOVIE Displays a MATLAB movie.
%   SHOWMOVIE(M,N,FPS,LOC) displays the movie M, N times, at a frame rate
%   FPS and location LOC. LOC = [left bottom] specifies the bottom, left
%   corner of the figure that displays the movie. The default values for
%   FPS and LOC are 15 frames per second and (0,0) respectively.
%
% See also MOVIE.

function showmovie(M, N, varargin)

% get frame rate and location
if(nargin == 4)
    fps = varargin{1};
    loc = varargin{2};
elseif(nargin == 3)
    fps = varargin{1};
    loc = [0 0];
else
    fps = 15;
    loc = [0 0];
end

% display movie
fig = figure;
[h w d] = size(M(1).cdata);
set(fig, 'Position', [loc(1) loc(2) w h]);
movie(fig,M,N,fps);