Home > ctdcal > eval_fit.m

eval_fit

PURPOSE ^

SYNOPSIS ^

function [final_stats]=eval_fit(sta,ccon,cprs,dcdp,bcon,coeff_cal,index)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [final_stats]=eval_fit(sta,ccon,cprs,dcdp,bcon,coeff_cal,index)
0002 coeff=coeff_cal;
0003 stat=sta(index);cond=ccon(index);pres=cprs(index);botco=bcon(index);dcdp=dcdp(index);
0004 fits=1:28;
0005 final_stats(:,1)=fits';
0006 %CalcoS
0007 newctdco(:,1)=coeff(1,2)*cond+coeff(1,1);
0008 newctdco(:,2)=coeff(2,2)*cond+coeff(2,3)*cond.*stat+coeff(2,1);
0009 newctdco(:,3)=coeff(3,2)*cond+coeff(3,3)*cond.*stat+coeff(3,4)*cond.*stat.^2+coeff(3,1);
0010 newctdco(:,4)=coeff(4,2)*cond+coeff(4,3)*cond.*stat+coeff(4,4)*cond.*stat.^2+coeff(4,5)*cond.*stat.^3+coeff(4,1);
0011 newctdco(:,5)=coeff(5,2)*cond+coeff(5,3)*cond.*stat+coeff(5,4)*cond.*stat.^2+coeff(5,5)*cond.*stat.^3+coeff(5,6)*cond.*stat.^4+coeff(5,1);
0012 newctdco(:,6)=coeff(6,2)*cond+coeff(6,3)*cond.*stat+coeff(6,4)*cond.*stat.^2+coeff(6,5)*cond.*stat.^3+coeff(6,6)*cond.*stat.^4+coeff(6,7)*cond.*stat.^5+coeff(6,1);
0013 newctdco(:,7)=coeff(7,2)*cond+coeff(7,3)*cond.*stat+coeff(7,4)*cond.*stat.^2+coeff(7,5)*cond.*stat.^3+coeff(7,6)*cond.*stat.^4+coeff(7,7)*cond.*stat.^5+coeff(7,8)*cond.*stat.^6+coeff(7,1);
0014 %Calcop
0015 newctdco(:,8)=coeff(8,2)*cond+coeff(8,1)+coeff(8,3)*pres;
0016 newctdco(:,9)=coeff(9,2)*cond+coeff(9,3)*cond.*stat+coeff(9,1)+coeff(9,4)*pres;
0017 newctdco(:,10)=coeff(10,2)*cond+coeff(10,3)*cond.*stat+coeff(10,4)*cond.*stat.^2+coeff(10,1)+coeff(10,5)*pres;
0018 newctdco(:,11)=coeff(11,2)*cond+coeff(11,3)*cond.*stat+coeff(11,4)*cond.*stat.^2+coeff(11,5)*cond.*stat.^3+coeff(11,1)+coeff(10,6)*pres;
0019 newctdco(:,12)=coeff(12,2)*cond+coeff(12,3)*cond.*stat+coeff(12,4)*cond.*stat.^2+coeff(12,5)*cond.*stat.^3+coeff(12,6)*cond.*stat.^4+coeff(12,1)+coeff(12,7)*pres;
0020 newctdco(:,13)=coeff(13,2)*cond+coeff(13,3)*cond.*stat+coeff(13,4)*cond.*stat.^2+coeff(13,5)*cond.*stat.^3+coeff(13,6)*cond.*stat.^4+coeff(13,7)*cond.*stat.^5+coeff(13,1)+coeff(13,8)*pres;
0021 newctdco(:,14)=coeff(14,2)*cond+coeff(14,3)*cond.*stat+coeff(14,4)*cond.*stat.^2+coeff(14,5)*cond.*stat.^3+coeff(14,6)*cond.*stat.^4+coeff(14,7)*cond.*stat.^5+coeff(14,8)*cond.*stat.^6+coeff(14,1)+coeff(14,9)*pres;
0022 %Calcodcdp
0023 newctdco(:,15)=coeff(15,2)*cond+coeff(15,1)+coeff(15,3)*dcdp;
0024 newctdco(:,16)=coeff(16,2)*cond+coeff(16,3)*cond.*stat+coeff(16,1)+coeff(16,4)*dcdp;
0025 newctdco(:,17)=coeff(17,2)*cond+coeff(17,3)*cond.*stat+coeff(17,4)*cond.*stat.^2+coeff(17,1)+coeff(17,5)*dcdp;
0026 newctdco(:,18)=coeff(18,2)*cond+coeff(18,3)*cond.*stat+coeff(18,4)*cond.*stat.^2+coeff(18,5)*cond.*stat.^3+coeff(18,1)+coeff(18,6)*dcdp;
0027 newctdco(:,19)=coeff(19,2)*cond+coeff(19,3)*cond.*stat+coeff(19,4)*cond.*stat.^2+coeff(19,5)*cond.*stat.^3+coeff(19,6)*cond.*stat.^4+coeff(19,1)+coeff(19,7)*dcdp;
0028 newctdco(:,20)=coeff(20,2)*cond+coeff(20,3)*cond.*stat+coeff(20,4)*cond.*stat.^2+coeff(20,5)*cond.*stat.^3+coeff(20,6)*cond.*stat.^4+coeff(20,7)*cond.*stat.^5+coeff(20,1)+coeff(20,8)*dcdp;
0029 newctdco(:,21)=coeff(21,2)*cond+coeff(21,3)*cond.*stat+coeff(21,4)*cond.*stat.^2+coeff(21,5)*cond.*stat.^3+coeff(21,6)*cond.*stat.^4+coeff(21,7)*cond.*stat.^5+coeff(21,8)*cond.*stat.^6+coeff(21,1)+coeff(21,9)*dcdp;
0030 %Calcopdcdp
0031 newctdco(:,22)=coeff(22,2)*cond+coeff(22,1)+coeff(22,3)*pres+coeff(22,4)*dcdp;
0032 newctdco(:,23)=coeff(23,2)*cond+coeff(23,3)*cond.*stat+coeff(23,1)+coeff(23,4)*pres+coeff(23,5)*dcdp;
0033 newctdco(:,24)=coeff(24,2)*cond+coeff(24,3)*cond.*stat+coeff(24,4)*cond.*stat.^2+coeff(24,1)+coeff(24,5)*pres+coeff(24,6)*dcdp;
0034 newctdco(:,25)=coeff(25,2)*cond+coeff(25,3)*cond.*stat+coeff(25,4)*cond.*stat.^2+coeff(25,5)*cond.*stat.^3+coeff(25,1)+coeff(25,6)*pres+coeff(25,7)*dcdp;
0035 newctdco(:,26)=coeff(26,2)*cond+coeff(26,3)*cond.*stat+coeff(26,4)*cond.*stat.^2+coeff(26,5)*cond.*stat.^3+coeff(26,6)*cond.*stat.^4+coeff(26,1)+coeff(26,7)*pres+coeff(26,8)*dcdp;
0036 newctdco(:,27)=coeff(27,2)*cond+coeff(27,3)*cond.*stat+coeff(27,4)*cond.*stat.^2+coeff(27,5)*cond.*stat.^3+coeff(27,6)*cond.*stat.^4+coeff(27,7)*cond.*stat.^5+coeff(27,1)+coeff(27,8)*pres+coeff(27,9)*dcdp;
0037 newctdco(:,28)=coeff(28,2)*cond+coeff(28,3)*cond.*stat+coeff(28,4)*cond.*stat.^2+coeff(28,5)*cond.*stat.^3+coeff(28,6)*cond.*stat.^4+coeff(28,7)*cond.*stat.^5+coeff(28,8)*cond.*stat.^6+coeff(28,1)+coeff(28,9)*pres+coeff(28,10)*dcdp;
0038 residuals=newctdco-repmat(botco,1,28);
0039 final_stats(:,2)=std(residuals)';
0040 final_stats(:,3)=mean(residuals)';

Generated on Fri 08-Oct-2004 11:57:17 by m2html © 2003