% REFSCRIPT - view stats between Ed490 and Ed670 and 683 reffile = 'refstats.txt'; fid = fopen(reffile,'wt'); fprintf(fid,'%%mean(Ed490) std(Ed490) mean(Ed670) std(Ed670) mean(Ed683) mean(Ed670)\n'); f = getfname('H:\n98\gp3-98-ka\SatlanticProfiler\*ref'); for i = 1:15 x = qreadref(['H:\n98\gp3-98-ka\SatlanticProfiler\' f(i,:)]); m = mean(x); s = std(x); fprintf(fid,'%12.7f%12.7f%12.7f%12.7f%12.7f%12.7f\n',m(1),s(1),m(2),s(2),m(3),s(3)); end fclose(fid); fprintf(1,'Data written to file: %s\n\n',reffile); xxx = load(reffile); errorbar(xxx(:,1),xxx(:,3),xxx(:,4),'r.') xlabel('Ed490') ylabel('Ed670 (red), Ed683 (blue)') hold on errorbar(xxx(:,1),xxx(:,5),xxx(:,6),'b.') [a r] = regress_linear(xxx(:,1),xxx(:,3)); plot(xxx(:,1),(a(1)*xxx(:,1)+a(2)),'r') display('Place equation on graph') gtext(['Ed670 = ' num2str(a(1)) '*Ed490 + ' num2str(a(2)) ' r^2 = ' num2str(r)]) [a r] = regress_linear(xxx(:,1),xxx(:,5)); plot(xxx(:,1),(a(1)*xxx(:,1)+a(2)),'b') display('Place equation on graph') gtext(['Ed683 = ' num2str(a(1)) '*Ed490 + ' num2str(a(2)) ' r^2 = ' num2str(r)])