interpolating between 2D slices

Assuming you have N time slices, then you can first concatenate the arrays you have, then permute (because interp1 has to have interpolated dimension first), then interpolate:

% Your 2D arrays:
x1 = [1 2; 3 4];
x2 = [2 3; 4 5];
% Concatenate:
x = cat(3,x1,x2);
% Permute to get interpolated dimension first:
x = permute(x,[3 1 2])
% Define arbitrary unit for time slices:
t0 = [1 2];
% Interpolate to time slice at t=1.5:
x_interp = interp1(t0,x,1.5)

I see that your input 2D arrays are quite large, so you may need to do this in chunks.

[griddata3 is a deprecated function, and you probably don't want to use it.]


你可能感兴趣的:(function,Arrays,input,deprecated)