Typical problems in this class include polynomial interpolation Φ(x;a0,,an) = a0 + a1x + a2x2 + ··· + anxn, as well as trigonometric interpolation Φ(x;a0,,an) = a0 + a1exi + a2e2xi + ··· + anenxi (i2 = −1).
Matlab Built-in Polynomial Interpolation: polyfit
The basic function-call is p=polyfit(x,y,m), where x is a vector of �� independent values, y is the corresponding vector of �� dependent values and �� = �� − 1.
The function returns the coefficient vector of the (�� − 1)-order interpolation polynomial.
Interpolation with python functions
The interpolant polynomial can be computed with numpy function polyfit if we choose as polynomial degree the number of the nodes minus one.
The output is the coefficients of the polynomial, from an to a0.