Afficher commentaires plus anciens
用MATLAB软件进行计算.
1)编写函数M-文件 nongdu.m
function f = nongdu(x,tdata)
f = x(1)+x(2)*exp(-0.02*x(3)*tdata);
其中 x(1) = a;x(2) = b;x(3) = k;
2) 在工作空间中执行以下命令(test1.m)
tdata = linspace(100,1000,10);
cdata =[4.54 4.99 5.35 5.65 5.90 6.10 ...
6.26 6.39 6.50 6.59];
x0 = [0.2,0.05,0.05];
x=lsqcurvefit (‘nongdu’,x0,tdata,cdata)
3) 输出结果: x = 0.007 -0.003 0.1012
即 k = 0.1012, a = 0.007, b = -0.003,
为啥我得到的结果是:x = -85.9771 90.3988 -0.0014
并提示
Solver stopped prematurely.
lsqcurvefit stopped because it exceeded the function evaluation limit,
options.MaxFunEvals = 300 (the default value).
该如何解决?谢谢
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur 数学 dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!