griddedInterpolant for 3D matrix using grid vectors; not enough sample points?
Mostrar comentarios más antiguos
I'm trying to interpolate a large 3D (time-series) double-floating-point variable in one direction efficiently by grid interpolation. Basically, my original matrix is structured as follows (block's colors are colorcoded by magnitude for illustrative purposes):

When I ran the below function on my dataset, it returned an error saying that "interpolation requires at least two sample points in each dimension" -even though my input matrix and grid vectors match (and my matrix is clearly multidimensional)... is there anything I'm doing that's obviously wrong?
Thank you in advance!
function feature = myFunction(axial, lateral, t, d1, other variables)
% "axial", "lateral", and "t" are vectors of different lengths
% "d1" is a 3-D vector (axial x lateral x t)
% "itpfctr" (interpolation factor) is derived somewhere along the lines...
dt=(t(2)-t(1))*itpfctr;
t_interp=(t(1):dt:t(end)); % upsample time vector; "dt" is named for later use
x=axial(:)'; y=lateral(:)'; z=t(:)'; % do these even need to be row vectors?
ZZ=t_interp(:)';
gv={x,y,z}; % the grid vector in question
F=griddedInterpolant(gv,d1,'cubic');
d1_interp=F({x,y,ZZ});
%... other calculations using d1_interp that output 2-D matrix "feature"
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Multidimensional Arrays en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!