Back to Polynomials
polyfit
Least-squares polynomial fit of the given degree.
Syntax
polyfit(x, y, deg) → r
Backends
TypeScriptnumwa
Description
Least-squares polynomial fit of the given degree.
Parameters
| Name | Description |
|---|---|
| x | x-coordinates of sample points |
| y | y-coordinates of sample points |
| deg | Degree of the fitting polynomial |
Returns
Polynomial coefficients of the best fit (descending order)