Skip to content

interpn

general · scripts/general/interpn.m

: vi = interpn (x1, x2, …, v, y1, y2, …)
: vi = interpn (v, y1, y2, …)
: vi = interpn (v, m)
: vi = interpn (v)
: vi = interpn (…, method, extrapval)

Interpolate the N-dimensional array v, sampled on a grid in ndgrid layout, at the query points y1, y2, ….

The grid coordinates x1, … default to 1:size (v, k). Query arrays of equal size give one result per point; query vectors of differing orientation are expanded into a grid. method is "linear" (default), "nearest", "spline", "pchip", "makima" or "cubic". Queries outside the grid give extrapval (default NaN; the spline method extrapolates by default). interpn (v, m) refines the grid m times.