24小时热门版块排行榜    

查看: 482  |  回复: 2

myw052

金虫 (正式写手)

博士

[求助] 散点图函数拟合

本人需要对下面的数据进行拟合,拟合函数为x=B1+B2*lg(y-B3),其中lg表示以10为底的log函数。需要拟合出B1,B2,B3的数值。

式中x为下面数据的第一列,y为下列数据的第二列。
能用matlab编制程序最好,不能也行,只要能拟合出来系数B1 B2 B3的值也行。

希望版主能出来帮下忙。。。
3.004  640.19
3.297  591.08
3.345  583.34
3.465  564.69
3.585  546.54
3.769  519.82
3.959  493.58
4.018  485.67
4.278  452.43
4.475  400.28
4.802  379.72
5.036  367.44
5.151  368.26
5.282  367.44
5.315  341.13
5.386  356.70
5.398  369.09
5.729  356.70
5.866  356.70
6.296  359.17
6.302  343.58
回复此楼

» 猜你喜欢

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

天天快乐
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
回帖置顶 ( 共有1个 )

dbb627

荣誉版主 (著名写手)

【答案】应助回帖

★ ★ ★ ★ ★ ★ ★ ★ ★ ★
myw052: 金币+10, ★★★★★最佳答案, 完全正确,多谢版主。 2012-04-15 13:34:33
myw052: 回帖置顶 2012-04-15 13:34:39
结果见图


The more you learn, the more you know, the more you know, and the more you forget. The more you forget, the less you know. So why bother to learn.
3楼2012-04-15 11:49:24
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
普通回帖

dbb627

荣誉版主 (著名写手)

【答案】应助回帖

感谢参与,应助指数 +1
>> A=[3.004  640.19
3.297  591.08
3.345  583.34
3.465  564.69
3.585  546.54
3.769  519.82
3.959  493.58
4.018  485.67
4.278  452.43
4.475  400.28
4.802  379.72
5.036  367.44
5.151  368.26
5.282  367.44
5.315  341.13
5.386  356.70
5.398  369.09
5.729  356.70
5.866  356.70
6.296  359.17
6.302  343.58];
x=A(:,1);y=A(:,2);
st_ = [2 2 3] ;
ft_ = fittype('B1+B2*log10(y-B3)','dependent',{'x'},'independent',{'y'},'coefficients',{'B1', 'B2','B3'});
[cf_,good]= fit(y,x,ft_ ,'Startpoint',st_)
h_ = plot(cf_,'fit',0.95);
legend off;  % turn off legend from plot method call
set(h_(1),'Color',[1 0 0],...
     'LineStyle','-', 'LineWidth',2,...
     'Marker','none', 'MarkerSize',6);
hold on,plot(y,x,'*')

cf_ =

     General model:
     cf_(y) = B1+B2*log10(y-B3)
     Coefficients (with 95% confidence bounds):
       B1 =       11.65  (5.446, 17.86)
       B2 =      -3.371  (-5.779, -0.9636)
       B3 =       292.6  (210.3, 375)

good =

           sse: 1.7251
       rsquare: 0.9180
           dfe: 18
    adjrsquare: 0.9089
          rmse: 0.3096
The more you learn, the more you know, the more you know, and the more you forget. The more you forget, the less you know. So why bother to learn.
2楼2012-04-15 11:46:46
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 myw052 的主题更新
信息提示
请填处理意见