想必很多小伙伴除了会使用cftool进行曲线或者曲面拟合外,还经常使用fit函数指定函数形式对数据进行拟合,此时我们往往会得到一个fitresult,大家在命令行窗口输入firresult,往往只会看见一些拟合式子的系数,如下代码所示:
% Matlab
% fit的常见用法
load census
fitresult = fit(cdate,pop,'poly3','normalize','on');
fitresult
得到的结果如下:
% Matlab
fitresult =
Linear model Poly3:
fitresult(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.
而只有这些系数我们不好处理,所以小编之前的帖子中提供