function polyfit

Returns a N-th order polynomial fit to X. X must be 1-dimensional. The function returns a vector of size (N+1)*2. The fittet polynomial has the following form:
   f(x) = a0 + a1 * x + ... + aN * X^N The values a0, ..., aN are returned in the first N elements of the returned vector, their respective errors in the elements N+1...2*N.

result = polyfit(X, N [, CHISQ])

X:   A vector.
N:   An integer number.
CHISQ:   If set to a named variable, the variable is overwritten with the chi-squared of the fit.

See also
function polyfitxy
function polyfitxyerr
function polyfit2d
function polyfit2derr