24小时热门版块排行榜    

查看: 492  |  回复: 2

大海的声音

新虫 (小有名气)

[求助] MATLAB非线性拟合出错怎么回事? 已有1人参与

X=[ ];y=[ ];  //输入数据
plot(x,y,'-or');
>> c0=[0.98 0.00844 2.1144];
>> n=length(x);
>> fun=inline('1000*x.*(1-c(1)+c(1).*exp(-(x/c(2)).^c(3)))','c','x');
>> [c,r,j]=nlinfit(x,y,fun,c0);
Sample Text
> In nlinfit at 240
[c,r,j]=nlinfit(x,y,fun,c0)
……………………..
……………………..
……………………..
.
.
.
Format long
>> c
c =
  1.0e+002 *
   6.991289140190613   0.232158704730335   0.008642422367326
y1=1000*x.*(1-c(1)+c(1).*exp(-(x/c(2)).^c(3)));
>> R2=1-sum((y1-y).^2)./sum((y1-mean(y)).^2);
>> sqrt(R2)
ans =
   0.480838537767861
中间两个Warning是怎么回事?而且相关系数很低这是怎么回事?请大家指导!
回复此楼

» 本帖附件资源列表

  • 欢迎监督和反馈:小木虫仅提供交流平台,不对该内容负责。
    本内容由用户自主发布,如果其内容涉及到知识产权问题,其责任在于用户本人,如对版权有异议,请联系邮箱:xiaomuchong@tal.com
  • 附件 1 : m2.csv
  • 2015-01-14 10:43:37, 204.29 K

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

大海的声音

新虫 (小有名气)

刚才输错了,完整的是这样的
X=[ ];y=[ ];  //输入数据
plot(x,y,'-or');
>> c0=[0.98 0.00844 2.1144];
>> n=length(x);
>> fun=inline('1000*x.*(1-c(1)+c(1).*exp(-(x/c(2)).^c(3)))','c','x');
>> [c,r,j]=nlinfit(x,y,fun,c0);
Warning: Iteration limit exceeded.  Returning results from final iteration.
In nlinfit at 193
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 240
[c,r,j]=nlinfit(x,y,fun,c0)
……………………..
……………………..
……………………..
.
.
.
Format long
>> c
c =
  1.0e+002 *
   6.991289140190613   0.232158704730335   0.008642422367326
y1=1000*x.*(1-c(1)+c(1).*exp(-(x/c(2)).^c(3)));
>> R2=1-sum((y1-y).^2)./sum((y1-mean(y)).^2);
>> sqrt(R2)
ans =
   0.480838537767861
2楼2015-01-14 10:46:01
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

匿名

用户注销 (职业作家)

Matlab专家

★ ★ ★
感谢参与,应助指数 +1
大海的声音: 金币+3, 有帮助 2015-01-16 18:33:17
本帖仅楼主可见
3楼2015-01-14 11:14:13
已阅   申请程序强帖   回复此楼   编辑   查看我的主页
相关版块跳转 我要订阅楼主 大海的声音 的主题更新
信息提示
请填处理意见