查看单个帖子
旧 2008-10-31, 17:25   #2
huaijuliu
普通会员
 
注册日期: 2008-01-27
年龄: 38
帖子: 31
声望力: 18
huaijuliu 正向着好的方向发展
默认 回复: [求助]关于MATLAB中lsqcurvefit、polyfit用法的探讨

polyfit函数拟合出来的就是一个多项式,而多项式的系数都是用最小二乘法得出的。
可以用help polyfit来看帮助,会发现有这么一句话:
P = POLYFIT(X,Y,N) finds the coefficients of a polynomial P(X) of
degree N that fits the data Y best in a least-squares sense.
既然Polyfit是用最小二乘法拟合多项式曲线,按说应该两个函数求出的系数矩阵相同,可是总是会存在偏差。
huaijuliu 当前离线   回复时引用此帖