<< polyder | Polynomials | polyint >> |
p = polyfit(x, y, n) |
vector: query points
vector: fitted values at query points
positive scalar: degree of polynomial fit
vector: Least-squares fit polynomial coefficients
p = polyfit(x, y, n) returns the coefficients for a polynomial p(x) of degree n that is a best fit for the data in y.
x = linspace(0, 8 * pi, 15);
y = sin(x);
p = polyfit(x, y, 7)
Version | Description |
---|---|
1.0.0 | initial version |
Allan CORNET