function testprr(i) [eu crd cfl] = getprrdata; downcast(eu, crd, cfl); fprintf(1, '\n*****************************************************************\n'); fprintf(1, 'Select depth limits on the figure, then press any key to continue\n'); fprintf(1, '*****************************************************************\n'); pause; UserData = get(gcf, 'UserData'); close(gcf); lims = sort(UserData.lims); eu = eu([lims(1):lims(2)],:); b = bbopbin(eu, cfl, 1); h(1) = plot(eu(:,i),eu(:,10),'b.'); set(gca,'Ydir','reverse'); hold on; %h(1) = plot(eu(:,i),eu(:,10),'b-'); h(2) = plot(b(:,i),b(:,10), 'r.'); %h(2) = plot(b(:,i),b(:,10), 'r-'); lam = leastsq('fitfunexp', [1 0]', [0 1e-3 0 0 1], [], eu(:,10), eu(:,i)); c = fitfunexpc(lam, eu(:,10), eu(:,i)); yf = funexp(lam, c, eu(:,10)); h(3) = plot(yf,eu(:,10),'c'); lam = leastsq('fitfunexp', [1 0]', [0 1e-3 0 0 1], [], b(:,10), b(:,i)); c = fitfunexpc(lam, b(:,10), b(:,i)); yf = funexp(lam, c, b(:,10)); h(4) = plot(yf,b(:,10),'m'); legend(h,'Raw','Binned','Raw Fit','Bin Fit');