|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
请问非线性最小二乘拟合编程,我好像求就是求不出来,请各位高手帮忙
function y=myfun(abc,t)
y=abc(1)/(1+abc(2)*exp(-abc(3)*t))^(1/abc(4));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%主程序如下
t=[0,1,2,3];
y=[2.010,1.210,1.740,0.450];
[A,res]=lsqcurvefit('zhidao_aacceedd123',ones(1,4),t,y);
L=A(1)
u=A(2)
b=A(3)
fi=A(4)
%%%%%%%%%%%%%%%%%%
运行后,显示如下:
??? Error using ==> optim\private\lsqncommon
User supplied function failed with the following error:
Attempted to access abc(3); index out of bounds because numel(abc)=2.
Error in ==> lsqcurvefit at 149
[x,Resnorm,FVAL,EXITFLAG,OUTPUT,LAMBDA,JACOB] = ...
Error in ==> Untitled2 at 3
[A,res]=lsqcurvefit('myfun',ones(1,2),t,y);
%%%%%%%%%
不知道什么意思,还请各位高手帮忙看看啊 |
|