Interpolation

Syntax: | `vout = INTERPOLATE(x,y,xout,'SPLINE') vout = INTERPOLATE(x,y,xout,'LINEAR') vout = INTERPOLATE(x,y,xout,'LAGRANGE') vout = INTERPOLATE(x,y,xout,'FC') mout = SPLINTERP(x,y,n)`

The `INTERPOLATE` function interpolates the data contained in vector `x`, the independent variable, and vector `y`, the dependent variable. `x` must be strictly monotonically increasing. The interpolant locations are given in vector `xout`. The `INTERPOLATE` function will return the interpolated values as a vector with the same length as `xout`. The algorithm that is employed depends on the keyword that is used.

The `SPLINTERP` function interpolates the data contained in vector `x`, the independent variable, and vector `y`, the dependent variable. There are no restrictions on `x`, it doesn't even need to be increasing. The number of interpolant locations is given in scalar `n`, which must be greater than `1`. The output of the `SPLINTERP` function is a matrix with `n` rows and `2` columns. The first column will contain the output locations and the second column the interpolated values at those locations.

An interpolated curve will always pass through the original data points. If it is not important that the curve pass through the original data, use the `SMOOTH` function, unless your independent variable is not monotonically increasing. In that case, use the `SPLSMOOTH` function.

Linear interpolation
Spline interpolation
Lagrange interpolation
Fritch-Carlson interpolation
SPLINTERP function
2D interpolation