MATLAB拟合fittype读取

找了好久,记录一下:

[xData, yData] = prepareCurveData( yr, b );

% Set up fittype and options.
ft = fittype( 'poly1' );

% Fit model to data.
[g, gof] = fit( xData, yData, ft );

g就是下面的curvefit

>> curvefit

curvefit = 
     Linear model Poly3:
     curvefit(x) = p1*x^3 + p2*x^2 + p3*x + p4
       where x is normalized by mean 1890 and std 62.05
     Coefficients (with 95% confidence bounds):
       p1 =       0.921  (-0.9743, 2.816)
       p2 =       25.18  (23.57, 26.79)
       p3 =       73.86  (70.33, 77.39)
       p4 =       61.74  (59.69, 63.8)
>> formula(curvefit)
ans = 
'p1*x^3 + p2*x^2 + p3*x + p4'
>> coeffnames(curvefit)
ans = 4x1 cell
    {'p1'}
    {'p2'}
    {'p3'}
    {'p4'}
>> coeffvalues(curvefit)
ans = 1×4

    0.9210   25.1834   73.8598   61.7444
>> confint(curvefit)
ans = 2×4

   -0.9743   23.5736   70.3308   59.6907
    2.8163   26.7931   77.3888   63.7981

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值