matlab中nlinfit非线性拟合求参数x1=[0.4292 0.4269 0.381 0.4015 0.4117 0.3017];>> x2=[0.00014 0.00059 0.0126 0.0061 0.00425 0.0443];>> y=[0.517 0.509 0.44 0.466 0.479 0.309];>> myfunc=inline('2.350176*beta(1)*(1-1/beta(2))*(1-(1-x1^(1/beta(2))

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/06 09:54:20
matlab中nlinfit非线性拟合求参数x1=[0.4292 0.4269 0.381 0.4015 0.4117 0.3017];>> x2=[0.00014 0.00059 0.0126 0.0061 0.00425 0.0443];>> y=[0.517 0.509 0.44 0.466 0.479 0.309];>> myfunc=inline('2.350176*beta(1)*(1-1/beta(2))*(1-(1-x1^(1/beta(2))

matlab中nlinfit非线性拟合求参数x1=[0.4292 0.4269 0.381 0.4015 0.4117 0.3017];>> x2=[0.00014 0.00059 0.0126 0.0061 0.00425 0.0443];>> y=[0.517 0.509 0.44 0.466 0.479 0.309];>> myfunc=inline('2.350176*beta(1)*(1-1/beta(2))*(1-(1-x1^(1/beta(2))
matlab中nlinfit非线性拟合求参数
x1=[0.4292 0.4269 0.381 0.4015 0.4117 0.3017];
>> x2=[0.00014 0.00059 0.0126 0.0061 0.00425 0.0443];
>> y=[0.517 0.509 0.44 0.466 0.479 0.309];
>> myfunc=inline('2.350176*beta(1)*(1-1/beta(2))*(1-(1-x1^(1/beta(2)))^beta(2))^2*(x1^(-1/beta(2))-1)^(-beta(2))*x1^(-1/beta(2)-0.5)*x2','beta','x1','x2');
>> beta=nlinfit(x1,x2,y,myfunc,[8 0.5]);
y是函数;x1,x2是自变量;要求beta(1)和beta(2),哪里不对?
出错信息
Error using ==> statset
Expected argument 2 to be a parameter name string or an options structure
created with STATSET.
Error in ==> nlinfit at 91
options = statset(statset('nlinfit'),options);
beta=nlinfit(x,y,@myfun,[8 0.5])
我怎么把这句改为beta=nlinfit(x,y,@myfun,[8;0.5])才能运行出结果?我不太懂啊.还有,它上面有些警告.Warning:Rank deficient,rank = 1,tol = 5.7039e-013.
> In nlinfit at 192
Warning:The Jacobian at the solution is ill-conditioned,and some
model parameters may not be estimated well (they are not identifiable).
Use caution in making predictions.
> In nlinfit at 272
beta =
1.0e+010 *
-5.6511
0.0000
是不是数据不够好,拟合的有些不好?

matlab中nlinfit非线性拟合求参数x1=[0.4292 0.4269 0.381 0.4015 0.4117 0.3017];>> x2=[0.00014 0.00059 0.0126 0.0061 0.00425 0.0443];>> y=[0.517 0.509 0.44 0.466 0.479 0.309];>> myfunc=inline('2.350176*beta(1)*(1-1/beta(2))*(1-(1-x1^(1/beta(2))
建立函数文件:
function y = myfun(beta,x)
y = 2.350176*beta(1)*(1-1/beta(2))*(1-(1-x(:,1).^(1/beta(2))).^beta(2)).^2.*(x(:,1).^(-1/beta(2))-1).^(-beta(2)).*x(:,1).^(-1/beta(2)-0.5).*x(:,2);
运行代码:
x=[0.4292 0.4269 0.381 0.4015 0.4117 0.3017; 0.00014 0.00059 0.0126 0.0061 0.00425 0.0443];
x = x';
y=[0.517 0.509 0.44 0.466 0.479 0.309];
y = y';
beta=nlinfit(x,y,@myfun,[8 0.5])
运行结果:
beta =
-55262931764.9336 0.0517