最小二乘法拟合曲线MATLAB中如何应用
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/25 12:02:49
最小二乘法拟合曲线
MATLAB中如何应用
MATLAB中如何应用
help polyfit
POLYFIT Fit polynomial to data.
POLYFIT(X,Y,N) finds the coefficients of a polynomial P(X) of
degree N that fits the data,P(X(I))~=Y(I),in a least-squares sense.
[P,S] = POLYFIT(X,Y,N) returns the polynomial coefficients P and a
structure S for use with POLYVAL to obtain error estimates on
predictions.If the errors in the data,Y,are independent normal
with constant variance,POLYVAL will produce error bounds which
contain at least 50% of the predictions.
The structure S contains the Cholesky factor of the Vandermonde
matrix (R),the degrees of freedom (df),and the norm of the
residuals (normr) as fields.
POLYFIT Fit polynomial to data.
POLYFIT(X,Y,N) finds the coefficients of a polynomial P(X) of
degree N that fits the data,P(X(I))~=Y(I),in a least-squares sense.
[P,S] = POLYFIT(X,Y,N) returns the polynomial coefficients P and a
structure S for use with POLYVAL to obtain error estimates on
predictions.If the errors in the data,Y,are independent normal
with constant variance,POLYVAL will produce error bounds which
contain at least 50% of the predictions.
The structure S contains the Cholesky factor of the Vandermonde
matrix (R),the degrees of freedom (df),and the norm of the
residuals (normr) as fields.