Syntax: @POLYCOEF(X, Y, N)
X = a range representing a row or column vector of
independent variable values
Y = a range representing a row or column vector of
dependent variable values
N = polynomial degree in the range 1 to 10
@POLYCOEF generates the least squares coefficients for the polynomial fit.
The output of this function is a vector of length N+1 containing
The output vector will be a row vector if X and Y are row vectors, and a column vector if X and Y are column vectors.
Example:
Matrix B1..B5 =
B | |
1 | 1 |
2 | 2 |
3 | 3 |
4 | 4 |
5 | 5 |
Matrix C1..C5 =
C | |
1 | 3 |
2 | 5 |
3 | 11 |
4 | 18 |
5 | 31 |
@POLYCOEF(B1..B5, C1..C5, 2) =
1.6428571 |
-2.9571429 |
4.4 |