function [iter, wtlog, pri, pdat, g]=readrec(nf,in, fout); iter=fscanf(in,'%d',1); errcheck(iter,fout,iter); wtlog=fscanf(in,'%lf',1); errcheck(wtlog,fout,iter); pri=fscanf(in,'%lf',1); errcheck(pri,fout,iter); pdat=fscanf(in,'%lf',1); errcheck(pdat,fout,iter); for i=1:nf; g(i)=fscanf(in,'%lf',1); errcheck(g(i),fout,iter); end; end;