function writeASCII %WRITEASCII Write the image in a ascii file % % Copyright (c) 1995 by Claudio Rivetti and Mark Young % claudio@alice.uoregon.edu, mark@alice.uoregon.edu % global I H savepath Handlefig [name, path] = uiputfile([savepath '*.txt']); if ~isempty(name) & name ~= 0 f=watchon; statusbar('Writing ASCII file...'); fname = [path name]; [fp, errmsg]=fopen(fname, 'w+'); if fp==-1 error(errmsg); end ex=findobj('tag', 'EXP_TYPE'); if onoff(get(ex, 'checked')) fprintf(fp, '%s', H); fprintf(fp, '\n\n'); fprintf(fp, '%.4f ', I); else figure(Handlefig); drawnow; [g,m] = capture(Handlefig); fprintf(fp, '%6.4f %6.4f %6.4f\n', m') fprintf(fp, '\n\n'); fprintf(fp, '%.4f ', g); end fclose(fp); watchoff(f); clearstatusbar; end return