function [errVec, pca_used, nband] = read_proj(fname)
fid = fopen(fname, 'r');
if fid < 0, 
  disp([sprintf('Cannot open file "%s" for reading', fname)]);
 return;
end
[nband, count]=fscanf(fid,'%d',1);
[pca_used,count]=fscanf(fid,'%d',1);

errVec(1)=0;
indexVec(1)=1;
energy(1)=1;
len = 0;
eachentry=pca_used*nband+3;
while 1>0,
  
  [indexNow, count] = fscanf(fid,'%f',eachentry);
  
  if count ~= eachentry,
     break;
  end;
  len=len+1;
  for i=1:eachentry,
    errVec(len,i) = indexNow(i);
  end

end;
fclose(fid);
return;
