 clear M
 nframe = 20 ;
 for j=1:nframe
    xgrid = linspace(0,2*pi,401) ;
    y = sin((1 + 1/j) * xgrid) ;
    plot(xgrid,y)
    M(j) = getframe;
 end
 
 vmorder = [(1:nframe),((nframe-1):-1:2)] ;
 M = M(vmorder) ;

 
 movie(M,-1)
 
 %movie2avi(M,'TempMovie') ;
           %  this made 81 kb file, ugly compression
 %movie2avi(M,'TempMovie','quality',100) ;
           %  this made 104 kb file, ugly compression
 %movie2avi(M,'TempMovie','compression','none') ;
           %  this made 2,924 kb file, really same
 %movie2avi(M,'TempMovie','compression','none','fps',4) ;
           %  this made 2,924 kb file
 %movie2avi(M,'TempMovie','compression','Indeo5','keyframe',4,'fps',4) ;
           %  this bombed
 %movie2avi(M,'TempMovie','compression','Cinepak','keyframe',4,'fps',4) ;
            %  this made 77 kb file, but missed the color
            %  Worked on True color, but color is worse
 %movie2avi(M,'TempMovie','compression','MSVC','keyframe',4,'fps',4) ;
           %  this made 55 kb file, with good colors
           %  doesn't work with 65536 colors, nor with 32228
 %movie2avi(M,'TempMovie','compression','none','keyframe',4,'fps',4) ;
           %  this made 2,924 kb file
 %movie2avi(M,'TempMovie','compression','Cinepak','fps',4) ;
           %  this made 271 kb file, bad color
 %movie2avi(M,'TempMovie','compression','MSVC','keyframe',2,'fps',4) ;
           %  this made 382 kb file
 %movie2avi(M,'TempMovie','compression','Cinepak') ;
           %  this made 98 kb file
 %movie2avi(M,'TempMovie','compression','MSVC') ;
           %  this made 90 kb file, this doesn't work with True Color Graphics
 movie2avi(M,'TempMovie','compression','Indeo3') ;
           %  this made 81 kb file  
           %  Works for True Colors, but lossy, and colors are off
 
 disp('finished') ;