<< linefit Curve Fitters (curvefit)

Curve Fitters (curvefit) >> Curve Fitters (curvefit) > npolyfit

npolyfit

To fit a given set of data points to a polynomial.

Calling Sequence

A=npolyfit(x,y,n)

Arguments

x

an array of x axis points

y

an array of y axis points

n

the order of polynomial

A

an array that contains the coefficients of the polynomial, such that the first element contains the coefficient of x^0 and the last element contains the coefficient of x^n

Description

Fits the given set of points to a Polynomial.

Returns the coefficients of the polynomial.

Examples

x=[1,2,3,4,5];
y=[1,8,27,64,125];
a=npolyfit(x,y,3)

See Also


Report an issue
<< linefit Curve Fitters (curvefit)