


Read working directory with no arguments. Output depends on the function call


0001 function [varargout] = readdir(); 0002 %Read working directory with no arguments. Output depends on the function call 0003 % 0004 % 0005 fdir = fopen('./dirnames.dir','r'); 0006 %strippintg comment lines if any 0007 header=fgetl(fdir); 0008 if header(1)=='%' 0009 while header(1)=='%' 0010 header=fgetl(fdir); 0011 end 0012 varargout(1)= {header}; 0013 for i=2:nargout 0014 varargout(i)= {fgetl(fdir)}; 0015 end 0016 else 0017 frewind(fdir) 0018 for i=1:nargout 0019 varargout(i)= {fgetl(fdir)}; 0020 end 0021 end 0022 fclose(fdir); 0023 return