interp3
Interpolation for 3-D gridded data in meshgrid format
📝Syntax
Vq = interp3(X, Y, Z, V, Xq, Yq, Zq)
Vq = interp3(V, Xq, Yq, Zq)
Vq = interp3(V)
Vq = interp3(V, k)
Vq = interp3(..., method)
Vq = interp3(..., method, extrapval)
📥Input Arguments
Parameter Description
X, Y, Z Sample grid points: vectors or meshgrid arrays.
V Sample values: real or complex 3-D array.
Xq, Yq, Zq Query points.
method 'linear', 'nearest', 'cubic', 'makima', or 'spline'.
📤Output Arguments
Parameter Description
Vq Interpolated values.
📄Description

interp3 interpolates 3-D gridded data using meshgrid conventions. The default grid is X=1:size(V,2), Y=1:size(V,1), Z=1:size(V,3).

The cubic-family methods use a native tensor-product four-point stencil, with linear fallback on dimensions that have fewer than four samples.

interp3(V) and interp3(V,k) refine the default grid. Grid vectors must be strictly monotonic.

💡Examples
V = reshape(1:8, [2 2 2]);
Vq = interp3(V, 1.5, 1.5, 1.5)
V = reshape(1:8, [2 2 2]);
Vq = interp3(V, 1)
x = 1:2;
y = 1:2;
z = 1:2;
[X,Y,Z] = meshgrid(x, y, z);
V = reshape(1:8, [2 2 2]);
Vq = interp3(X, Y, Z, V, 1.5, 1.5, 1.5, 'linear')
V = reshape(1:8, [2 2 2]);
Vq = interp3(V, 0, 1.5, 1.5, 'linear', -1)
🔗See Also
interp1interp2interpnmeshgrid
Edit this page on GitHub