非线性拟合问题(拟合值始终跟初值一样)。
이전 댓글 표시
拟合出来的值始终跟给的初值一样啊。。。。咋回事呢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))
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!