function writeGIF %WRITEGIF Write the image in a gif file format % % Copyright (c) 1995 by Claudio Rivetti and Mark Young % claudio@alice.uoregon.edu, mark@alice.uoregon.edu % global savepath Handlefig Handleimg [name, path] = uiputfile([savepath '*.gif']); if ~isempty(name) & name ~= 0 f=watchon; statusbar('Writing GIF file...'); GIFname = [path name]; ex=findobj('tag', 'EXP_TYPE'); if onoff(get(ex, 'checked')) m=colormap; g=get(Handleimg, 'cdata'); else figure(Handlefig); drawnow; [g,m] = capture(Handlefig); end gifwrite(g,m,GIFname); watchoff(f); clearstatusbar; end return