非线性拟合问题(拟合值始终跟初值一样)。
Afficher commentaires plus anciens
拟合出来的值始终跟给的初值一样啊。。。。咋回事呢T.T求大神帮助。。
clear;
ep1=@(a,w)ones(size(w))+(a(1))^2.*((a(2))^2-w.^2)./(((a(2))^2-w.^2).^2+(a(3))^2*w.^2);
wdata=[6.28319E+15
6.27273E+15
...................
];
ep1data=[1.051239566
1.081177791
1.111554498
...........
];
a0=[1 1 1];
% c0 = lsqcurvefit ('fun', c0, xdata, ydata)
a = lsqcurvefit (ep1, a0, wdata, ep1data)
plot(wdata,ep1data,'.')
hold on
plot(wdata,ep1(a,wdata))
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Get Started with Curve Fitting Toolbox 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!