0001 function err = err_Tenefit_jd(fit,rho,f,boundsfac,enforce) 0002 % 0003 y = enforce; 0004 y(isnan(enforce)) = fit; 0005 % 0006 %err = norm(f-Tenefit_jd(rho,y(1),y(2),y(3),y(4))); 0007 err = norm(f-Tenefit_jd(rho,y(1),y(2),y(3),y(4))) + ... 0008 boundsfac*norm(f([1,end])-Tenefit_jd(rho([1,end]),y(1),y(2),y(3),y(4)));