5.4: Multidimensional Interpolation
( \newcommand{\kernel}{\mathrm{null}\,}\)
Suppose we are interpolating the value of a function of two variables,
z=f(x,y)
The known values are given by
zij=f(xi,yj)
with i=0,1,…,n and j=0,1,…,n. Note that the (x,y) points at which f(x,y) are known lie on a grid in the x−y plane.
Let z=g(x,y) be the interpolating function, satisfying zij=g(xi,yj). A twodimensional interpolation to find the value of g at the point (x,y) may be done by first performing n+1 one-dimensional interpolations in y to find the value of g at the n+1 points (x0,y),(x1,y),…,(xn,y), followed by a single one-dimensional interpolation in x to find the value of g at (x,y).
In other words, two-dimensional interpolation on a grid of dimension (n+1)× (n+1) is done by first performing n+1 one-dimensional interpolations to the value y followed by a single one-dimensional interpolation to the value x. Twodimensional interpolation can be generalized to higher dimensions. The MATLAB functions to perform two-and three-dimensional interpolation are interp2.m and interp3.m.