uu=-3:0.04:3; vv=-2.5:0.04:2.5; [xx,yy]=meshgrid(uu,vv); AA=[1 0.0]; BB=[-1 0.0]; x1=xx-AA(1); y1=yy-AA(2); x2=xx-BB(1); y2=yy-BB(2); r1=sqrt(x1.^2+y1.^2); r2=-sqrt(x2.^2+y2.^2); zz=sin(25*r1)./r1+sin(25*r2)./r2; surfl(xx,yy,zz); shading interp view(-30,50) axx=axis; drawnow tt=0; for ee=1:200 zz=sin(20*r1-tt)./r1+sin(20*r2-tt)./r2; surfl(xx,yy,zz);shading interp axis(axx) view(-30,50) tt=tt+pi/8; Inter(:,ee)=getframe; end movie(Inter,5,20) %saveas(gcf, ['frame_',sprintf('%03d',f),'.png']) %f = f+1; %convert -delay 30 frame_*.png my_first_movie.gif