polyfit()

Description:

Calculate the coefficient between two vectors in polynomial fitting.

Syntax:

polyfit(X,Y,n)

Note:

The function calculates the coefficient between vector X and vector Y, which are of same dimension, in a polynomial fitting with the degree of polynomial as n, and returns a sequence of coefficients containing n+1 members.

Parameters:

X/Y

Vectors of same dimension

n

A non-zero positive integer

Return value:

Sequence

Example:

 

A

 

1

[3,5,2,8]

 

2

[4,6,2,4]

 

3

=polyfit(A1,A2,2)