gifsicle --colors 256 -O1 -l0 -d20 frames*.gif > movie.gif
The options are -O1 stores only the changed pixels, -l0 loops forever, and -d20 sets the delay to 20 hundreths of a second between frames. The trick is creating a bunch of GIF frames. I do this in MATLAB by first outputting to TIFF files, like this:
print -dtiff -r100 -zbuffer frame03.tiff
In matlab, use the eval function to write a series of frames like this:
frame = 1;
for n = 1:TOTALFRAMES;
eval(['print -dtiff -r100 -zbuffer frame',num2str(frame,'%2.2i'),'.tiff']);
frame=frame+1;
end
I make the figure as big in inches as I want it in hundreds of pixles (the -r100 gives me 100 pixels per inch). Then convert these images to GIFS using convert by ImageMagick like this:
convert frame03.tiff frame03.gif
Here is a script that gets you from a bunch of numbered TIFF frames to an animated GIF. Go knock yourself out.