%generate and plot a cylinder for demo purposes figure(1) [X Y Z]=cylinder; surf(X,Y,Z) alpha(0.7); %make a movie of current axes rotating g=gca; f=gcf; set(g,'xtick',[]); set(g,'ytick',[]); set(g,'ztick',[]); set(g,'box','on'); set(g,'view',[0 35]); %zooming out is neccesary to keep the axes from changing in size as they %rotate zoom(f,1/sqrt(2)); %rotate axes and collect frames for movie for j=1:180 M(j)=getframe(f); set(g,'view',[2*j 35]); end %convert movie to .avi file movie2avi(M,'movie1.avi','fps',5);