matlab中nlinfit问题!mu=inline('beta(1)/(1+(beta(1)/100000-1)*exp(-beta(2)*(t-1981)))','beta','t')t=[1981,1982,1983,1984,1985]y=[1000,1111,1222,1333,1444]beta=nlinfit(t,y,mu,[0 0])L=beta(1)k=beta(2)目的是要拟合L和k,但是在nlinfit那里就

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/26 00:01:42
matlab中nlinfit问题!mu=inline(''beta(1)/(1+(beta(1)/100000-1)*exp(-beta(2)*(t-1981)))'',''beta'',''t'')t=[198

matlab中nlinfit问题!mu=inline('beta(1)/(1+(beta(1)/100000-1)*exp(-beta(2)*(t-1981)))','beta','t')t=[1981,1982,1983,1984,1985]y=[1000,1111,1222,1333,1444]beta=nlinfit(t,y,mu,[0 0])L=beta(1)k=beta(2)目的是要拟合L和k,但是在nlinfit那里就
matlab中nlinfit问题!
mu=inline('beta(1)/(1+(beta(1)/100000-1)*exp(-beta(2)*(t-1981)))','beta','t')
t=[1981,1982,1983,1984,1985]
y=[1000,1111,1222,1333,1444]
beta=nlinfit(t,y,mu,[0 0])
L=beta(1)
k=beta(2)
目的是要拟合L和k,但是在nlinfit那里就要报错!
? Error using ==> nlinfit
The inline model function generated the following error:
Error using ==> inlineeval
Error in inline expression ==> beta(1)/(1+(beta(1)/100000-1)*exp(-beta(2)*(t-1981)))
? Error using ==> mrdivide
Matrix dimensions must agree.
看不懂,求高手指点!

matlab中nlinfit问题!mu=inline('beta(1)/(1+(beta(1)/100000-1)*exp(-beta(2)*(t-1981)))','beta','t')t=[1981,1982,1983,1984,1985]y=[1000,1111,1222,1333,1444]beta=nlinfit(t,y,mu,[0 0])L=beta(1)k=beta(2)目的是要拟合L和k,但是在nlinfit那里就
mu=inline('beta(1)./(1+(beta(1)/100000-1)*exp(-beta(2)*(t-1981)))','beta','t');
t=[1981,1982,1983,1984,1985];
y=[1000,1111,1222,1333,1444];
beta=nlinfit(t,y,mu,[1000 3542]);
L=beta(1)
k=beta(2)
你写得好像是线性的,所以求出来的k有点问题.
你出错的原因是 beta(1)后面应该用点除.即 ./