Skip to content

griddatan

geometry · scripts/geometry/griddatan.m

: yi = griddatan (x, y, xi)
: yi = griddatan (x, y, xi, method)
: yi = griddatan (x, y, xi, method, options)

Interpolate scattered n-dimensional data.

x is m-by-n (one site per row), y is an m-by-1 column of values (possibly complex) and xi is p-by-n. The result is a p-by-1 column.

method is "linear" (default; also selected by an empty argument), "nearest" or, for two- and three-dimensional data, "natural". The linear method interpolates on the Delaunay triangulation of the sites, so queries outside their convex hull give NaN. The natural method is Sibson’s natural neighbor interpolation: the weights of a query are the areas its Voronoi cell (areas in 2-D, volumes in 3-D) would take over from the cells of the neighboring sites. It is continuous, smooth except at the sites, and NaN outside the convex hull. options is passed to the triangulation (see delaunayn).