Polynomial interpolation is unrelated from polynomial fitting. Polynomial fitting chase to take a single polynomial - generally of a low order - and finds those coefficients from which it gets the polynomial collectively as near to all the points as possible, but they may not actually hit any of the points.
Polynomial interpolation will always one order less than the number of points used; it will always go through the basis points used to create the interpolation. For instance, a first order polynomial interpolation shall always use the straight line between the two closes points in the data set. A second order polynomial interpolation will always make use of the quadratic that interpolates among the nearest three points -- depending on spacing, there may be two different but equally valid sets of points for user.
In scientific and engineering work engineers often have a set of measurements from which they wish to draw conclusions. One aspect of interpretation of the measurements is a curve to approximate the dataset. In most cases the linear method is not very accurate because the behavior of these systems are not linear. In this situation engineers/scientist use polynomial methods which usually means user fit a polynomial of a degree that closely matches the graphical trend to the data provided. The resulting curves/formulas can predict intermediate values. MATLAB provide us two functions for polynomial interpolation.
interpolate(xList, yList, X,
interpolate(nodes, values, ind,
interpolate computes an interpolating polynomial through data over a rectangular grid.
The call interpolate(xList, yList, X) with xList = [x1, …, xn] and yList = [y1, …, yn] gives back the polynomial of degree less than n in the variable X which interpolates the points (x1, y1), …, (xn, yn).
This call with a 1-dimensional grid xList is equal to the corresponding ‘multi-dimensional’ call interpolate([xList], array(1..n, [yList]), [X]).