非线性拟合问题(拟合值始终跟初值一样)。

拟合出来的值始终跟给的初值一样啊。。。。咋回事呢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))

 Respuesta aceptada

yoyoso
yoyoso el 18 de Nov. de 2022

0 votos

我在a(i)前乘了1e16,虽然能找到解,但感觉还不够好
ep1=@(a,w)ones(size(w))+(1e16*a(1))^2.*((1e16*a(2))^2-w.^2)./(((1e16*a(2))^2-w.^2).^2+(1e16*a(3))^2*w.^2);
你试试看,不过话说,你这个拟合表达式中的参数没什么具体的物理意义的吗?这样可以用来设初值以及检验结果的合理性。。。。

Más respuestas (0)

Categorías

Más información sobre Get Started with Curve Fitting Toolbox en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 18 de Nov. de 2022

Respondida:

el 18 de Nov. de 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!