定义:myfun1.m
function v=myfun1(beta,X)
v=beta(1)*exp(beta(2)*X)+beta(3);
运行:
beta = nlinfit(0:2:20,0.1*[1.32 1.38 1.67 1.93 2.45 2.97 3.70 4.32 5.48 6.68 7.9],@myfun1,[0 0 0])
结果:
[A B C]=
0.1029 0.1016 0.0152
定义:myfun1.m
function v=myfun1(beta,X)
v=beta(1)*exp(beta(2)*X)+beta(3);
运行:
beta = nlinfit(0:2:20,0.1*[1.32 1.38 1.67 1.93 2.45 2.97 3.70 4.32 5.48 6.68 7.9],@myfun1,[0 0 0])
结果:
[A B C]=
0.1029 0.1016 0.0152