function X = qreadref(FileName) % QREADREF - Quick and dirty reader for surface reference files (*.ref) from Satlantic % % Use as: x = greadref(FileName) : reads only the filename specified % x = qreadref : Reads all *.ref files in the % \ts0data\n98\gp3-98-ka\SatlanticProfiler\ directory % % QREADREF is used to read in Lu490, Ed670 and Ed683 from *.ref files % % Brian Schlining % 21 Jan 1999 %============== % Get FileName %============== if ~nargin PathS = 'H:\n98\gp3-98-ka\SatlanticProfiler\'; FileName = getfname([PathS '*.ref']); %[infile inpath] = uigetfile('*.out','Select ASCII Eqpac Data File',0,0); %if infile == 0 % return %end %FileName = [inpath infile]; end [r c] = size(FileName); n = 1; for i = 1:r if ~nargin fid = fopen([PathS FileName(i,:)],'rt'); else fid = fopen(FileName,'rt'); end for j = 1:49 s = fgetl(fid); end while ~feof(fid) s = fgetl(fid); n = n + 1; x = sscanf(s,'%f'); X(n,1) = x(14); % Ed412 X(n,2) = x(15); % Ed443 X(n,3) = x(16); % Ed490 X(n,4) = x(17); % Ed510 X(n,5) = x(19); % Ed555 X(n,6) = x(23); % Ed670 X(n,7) = x(24); % Ed683 end end