function []=make_move1()

% *************************************************************************

screen_size = get(0, 'ScreenSize');

klim=40;
numframes = klim;

% *************************************************************************
% % Movie code

% Here, I open a figure and set the size of this figure.
fig1 = figure(1);

x1=0*screen_size(3);
y1=0.1*screen_size(3);
x2=0.6*screen_size(3);
y2=0.7*screen_size(4);

set(fig1, 'Position', [x1 y1 x2 y2 ] );

% Next, I create a Matlab array called A_mov.  This array will store a
% separate contour plot.  These contourplots make up the frame of the
% movie.

% The first index of the array counts the contour plot (or the frame).
% The second index stores the actual figure or contour plot.

A_mov = moviein(numframes, fig1);
set(fig1, 'NextPlot', 'replacechildren')

% *************************************************************************

for k=1:klim
    
    time=0.1*k;
    
    filename1=strcat('contour_',num2str(k),'.fig');
       
    % Here, I open the kth contourplot into a temporary figure called
    % "tempfig".
    
    tempfig=openfig(filename1,'reuse','visible');
    set(tempfig, 'Position', [x1 y1 x2 y2 ] );
    title(strcat('t=',num2str(time)))
    
    % Now I place the temporary figure "tempfig" into the kth frame of the
    % movie array.
    
    A_mov(:,k) = getframe(tempfig);
    close(tempfig)
    
    display(strcat('k=',num2str(k)))
end

% Here is the Matlab command to turn the movie array into a replayable
% movie.

movie(fig1, A_mov,1,3);
save movie.mat A_mov;

% Finally, I turn the Matlab movie into a standard portable avi file.
% This part can be very tricky, and to get it to work across platforms,
% sometimes it is necessary to specify a certain codec.  Trial and error
% and googling are required here.



% %  Example with a codec specified, and with compression.:
% movie2avi(A_mov,'movie_compressed.avi','compression','Cinepak','quality',100,'fps',1);

% % Working example (on my computer):

movie2avi(A_mov, 'movie.avi', 'compression', 'None','fps',1);

% % In both examples, "fps" is a good parameter to adjust.  It is the
% % number of movie frames that gets played per second.

% *************************************************************************

end