FUNCTION REFERENCE

interp2

Two-dimensional interpolation on a regular grid.

Two-dimensional interpolation on a regular grid.

Syntax

vq = interp2(V, xq, yq)

Syntax

vq = interp2(X, Y, V, xq, yq)

Syntax

vq = interp2(..., method)

Syntax

vq = interp2(..., method, extrapval)

method is 'linear' (default) or 'nearest'. X and Y are grid vectors or

meshgrid matrices. If xq is a row and yq a column (or the reverse) the result

is the grid of all pairs; otherwise xq and yq are paired. Points outside the

grid give NaN, or extrapval.

Example

interp2([1 2 3;4 5 6;7 8 9], 1.5, 1.5)   % 3

Differences from MATLAB: 'cubic', 'spline' and 'makima' are not supported yet.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.