2D interpolation

Syntax: w = BIVINTERP(x,y,z,u,v)

This function interpolates, from values of the function given at input grid points in an x-y plane and for a given set of points in the plane, the values of a single-valued bivariate function z = z(x,y). The method is based on a piece-wise function composed of a set of bicubic polynomials in x and y. Each polynomial is applicable to a rectangle of the input grid in the x-y plane. Each polynomial is determined locally.

The first two input parameters are vectors. Vector x contains the x-coordinates of the input grid points, in ascending order. Vector y contains the y-coordinates of the input grid points, in ascending order. Both x and y must be monotonically increasing. The third parameter is a matrix, z, which contains the values of the function at the input grid points, z[i][j] is the data value at (x[i],y[j]). The last two parameters are vectors. Vector u contains the x-coordinates of the desired points, and vector v contains the y-coordinates of the desired points. Vectors u and v must have the same number of elements. The output is a vector, w, containing the interpolated values, w[i] is the interpolated value at the location (u[i],v[i]).

Algorithm derived from an article by Hiroshi Akima, Communications of the ACM, volume 17, number 1, January 1974, pp. 26-31.

  SPLINTERP function