title: Interpolation and derivative of 3D data in MATLAB (or Python or C)
body: <p>I have three 3D matrices X, Y, and Z that define a matrix V of the same size over some 3D spaces. The matrices are regularly spaced. Now, I'm trying to perform interpolation and also compute the spatial partial derivatives of V i.e for each pixel, compute how V changes with x, y, and z. I have read that interpolating and computing derivatives with splines leads to good results. For instance, I have worked before with splinefit and ppdiff (<a href="http://www.mathworks.com/matlabcentral/fileexchange/13812-splinefit" rel="nofollow">http://www.mathworks.com/matlabcentral/fileexchange/13812-splinefit</a>)</p>
  
  <p>How can I use splines that for the datasets I have? Is there some code available preferably in MATLAB (Python and C could work as well) to perform these kind of computations?</p>
  
  <p>Assuming I only want the derivatives at the sampled locations define by X, Y, and Z, could I do 1D spline approximations for each dimension and compute the partial derivatives that way? Maybe that should be a question for the math exchange. It would probably take a while, but it should work right?</p>
  
  <p>Thanks for your help!</p>