User`s guide
R2012a
7-14
Functionality What Happens
When You
Use This
Functionality
Use This Instead Compatibility Considerations
Passing mixed
orientation vectors to
interp3:
interp3(x, y, z,
V, xq, yq, zq)
Specifically, if one or
both of the following
are true:
• x, y, and z are a
combination of row
and column vectors.
• xq, yq, and zq are a
combination of row
and column vectors.
Still Runs Construct the full grid
with meshgrid first.
Alternatively, use
griddedInterpolant if you
have a large data set.
Modify all instances that
pass mixed orientation
vectors to interp3. You
can modify your code in one
of two ways:
• Call meshgrid to
construct the full grid
first.
[X,Y,Z] =
meshgrid(x, y, z);
[Xq,Yq,Zq] =
meshgrid(xq, yq,
zq);
Vq = interp3(X, Y,
Z, V, Xq, Yq, Zq);
• Pass the vectors to
griddedInterpolant
inside a cell array.
V = permute(V, [2 1
3]);
F =
griddedInterpolant({x,
y, z}, V);
Vq = F({xq, yq,
zq});
Vq = permute(Vq, [2
1 3]);