Mercurial > hg > ishara
view general/fileutils/tofile.m @ 58:ba866ae124c6
Now accepts single color index for all points.
author | samer |
---|---|
date | Fri, 09 Oct 2015 13:01:37 +0100 |
parents | e44f49929e56 |
children |
line wrap: on
line source
function tofile(outfile,varargin) % tofile - Run functions that need a file handle to write output % % tofile :: % path ~'file name to write to', % (fid -> action unit) ~'action taking file handle', % (fid -> action unit) ~'action taking file handle', % ... % -> action unit. % % Opens the given file in APPEND mode, then calls each function % passing the file handle to each. fh=fopen(outfile,'a'); fprintf(fh,'\n%% --- New session ---\n\n'); for i=1:length(varargin) fprintf(fh,'\n%% --- Running %s\n\n', func2str(varargin{i})); feval(varargin{i},fh); end fclose(fh);