Interpolation and Lookup Functions
In the following function, y and x are one-dimensional arrays which determine a piecewise linear function y(x). The x must be monotonic. The xp (for x -prime) can be an array of any dimensionality; the dimensions of the result will be the same as the dimensions of xp.
digitize(xp, x) returns indices of xp values
Note that integ is really an area-conserving interpolator.
If the xp coincide with x, you probably want to use
The on-line help documentation for interp describes how to use interp and integ with multidimensional y arrays.