[求助]非线性最小二乘拟合问题
请问非线性最小二乘拟合编程有啥技巧吗?我怎么就是求不出来呀function F = myfun228(x)
t=1:1280;
F = x(1)+x(2)*exp(x(3)*t)(x(4)cos(2*pi*x(5)*t)+sqrt(1-x(4)^2)*sin(2*pi*x(5)*t)])+x(6)*exp(x(7)*t);
= lsqnonlin(@myfun228,)
??? Error using ==> optim\private\lsqncommon
LSQNONLIN cannot continue because user supplied objective function failed with the following error:
Error: File: myfun228.m Line: 3 Column: 31
Unexpected MATLAB expression.
是函数表达式没写对?还是未知量太多呢?还是其实,请高手们帮忙看一下,谢谢!
C:\Documents and Settings\Administrator\My Documents\My Pictures\非线性最小二乘.bmp 怎么看不到图片呀?
现以附件的形式给出拟合问题
回复
%%%------------------------------------------------%%%1.的确存在"函数表达式没写对",请仔细检查;
2.初值选择有点奇怪;可以先全部用1试试;
3. t向量取太大,可试试取小一点.
%%%------------------------------------------------%%%
我随便算了一个,可以得到结果.
页:
[1]