MATLAB: Interpolating many matrices without for loop

interpolating 3d matrices loop

Hi everybody, well I want to interpolate a 3D matrix composed of 700x2x60 values. I want to interpolate with respect to an array of 700 values. But i want an interpolation only 1 dimension, for example
if i had:
3 1
6 2
9 3
60 times, with different values, i want to interpolate with respect to 1.5, 2.5 and 3 I would get 4.5 7.5 and 10.5, 60 times and with the values relative to each one of the 60 matrices.
So in essence its like interp1 but 60 times. And I can't manage to do it without a for loop which is time consuming. and i need to do it over 15000 times.
thank you for your answers

Best Answer

You can use reshape().
x=1:3;
y=3:3:9;
X=magic(3);
[M,N]=size(X);
Y=interp1(x,y,X(:),'linear','extrap');
Y=reshape(Y,M,N);