function mkgif(filename) Make a gif image of the current figure
0001 function mkgif(filename) 0002 % function mkgif(filename) 0003 % 0004 % Make a gif image of the current figure 0005 0006 % Capture screen figure 0007 x=getframe(gcf); 0008 0009 imwrite(x.cdata,'temp.ppm'); 0010 0011 % Translate to gif 0012 %cmd=sprintf('tifftopnm temp.tif | ppmtogif > %s',filename); 0013 cmd=sprintf('ppmtogif temp.ppm > %s',filename); 0014 unix(cmd); 0015 !rm temp.ppm* 0016 0017 return