<< gammainc Miscellaneous polyval >>

Stixbox >> Stixbox > Miscellaneous > polyfit

polyfit

Polynomial curve fitting

Calling Sequence

p = polyfit(x,y,n)
[p,s] = polyfit(x,y,n)

Parameters

x,y

two matrices or vectors of the same size.

Description

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 matrix s for use with polyval to produce error estimates on predictions.

<< gammainc Miscellaneous polyval >>