Interp Function
The interp function is used for interpolation and regression to interpolate at a given point the output of one of the following functions: cspline, lspline, pspline, bspline, or loess.
interp(vs, vx, vy, x) or interp(vs, Mxy, Mz, X)—Returns an interpolated value at x from the coefficients in vector vs, and the original data in vx and vy. When fitting a surface, X is a two-element vector at which to calculate the interpolated z values.
Arguments
vs is a vector generated by cspline, lspline, pspline, bspline, or loess.
vx and vy are the vectors of real data values with the same length.
x is the real value of the independent variable at which you want to evaluate the interpolation curve. For best results, this should be in the range of values in vx.
Mxy is a real n x 2 array of independent data specifying the x and y coordinates along the diagonal of a rectangular grid. You must therefore have the same number of x and y values in your independent data points.
Mz is a real n x n array of data. These are the z values corresponding to x and y values in Mxy.
X is the real, two-element vector of values at which you want to evaluate the interpolation surface.
Was this helpful?