|
【答案】应助回帖
★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ 感谢参与,应助指数 +1 xzhdty: 金币+1, 谢谢了 2012-05-22 06:01:48 chj787: 金币+15, ★★★★★最佳答案, 非常感谢!评分晚了,万分抱歉~! 2012-05-29 15:29:20
x=[0.8,0.85,0.9,0.94,1,1.1,1.14,1.144,1.146,1.148,1.149,1.15,1.151,1.152,1.153,1.157,1.25,1.3,1.35,1.4,1.45,1.5,1.55,1.6,1.65,1.7,1.75,1.8,1.85,1.9,1.95,2,2.05,2.1,2.15,2.2,2.25,2.3,2.35,2.4];
y=[129698.6607,81517.14907,48462.38869,30160.54842,12625.39888,830.7904906,0,2.343989057,8.695584894,18.42928479,24.54823752,31.4946096,39.26181681,47.84108015,57.22581538,102.7141275,687.9234793,3872.493796,7589.20011,11578.99871,15654.88623,19681.73873,23751.25051,27388.0944,30756.13673,33816.1486,36542.19252,38921.37873,40955.22819,42660.53072,44067.23581,45213.10408,46138.07991,46880.36067,47474.18002,47948.97387,48329.25318,48634.92208,48881.88591,49082.65691];
ybeta=inline('(beta(1)+beta(2)*x+beta(3)*x.^2+beta(4)*x.^3).*exp(-beta(2)*x)','beta','x');
beta=nlinfit(x,y,ybeta,[1e+004,0,-1e+004,1e+004]);
a=beta(1);
b=beta(2);
c=beta(3);
d=beta(4);
yy=(a+b*x+c*x.^2+d*x.^3).*exp(-b*x);
plot(x,yy,x,y,'*')
但是会显示
Warning: The Jacobian at the solution is ill-conditioned, and some
model parameters may not be estimated well (they are not identifiable).
Use caution in making predictions.所以可能还需要进一步手动优化,我做你何时用nlinfit也经常出现这个警告,期待有高手解答。
拟合结果是
3866678.20479525
2.55862906421524
-8281766.51676900
4642226.52606192
希望能帮到你 |
|