We have a 195x4 (double) matrix: A=[X Y Z temp], when ploted with scatter3(A(:,1), A(:,2), A(:,3),30, A(:,4), 'filled' ) gives something like this:

Now we want to generate a 'cube' colored with the interpolation of the temp=A(:,4) vector data.
So far we have tried interp3
% Base Grid
[Xm Ym Zm] = meshgrid(A(:,1), A(:,2), A(:,3));
% Grid Refinement
[Xq,Yq,Zq] = meshgrid(xmin:dx:xmax, ymin:dy:ymax, zmin:dz:zmax);
Aq = interp3(Xm,Ym,Zm,A(:,4),Xq,Yq,Zq);
Returns the following error:
Error using griddedInterpolant
The number of input coordinate arrays does not equal the number of dimensions
(NDIMS) of these arrays.
Error in interp3 (line 144)
F = griddedInterpolant(X, Y, Z, V, method,extrap);
Error in PDGEM_MT (line 112)
Aq = interp3(Xm,Ym,Zm,A(:,4),Xq,Yq,Zq);
So I think, may be a bad implementation and/or a wrong interpretation of the problem.
How to generate a 'cube'of that space colored with the volume interpolation of A(:,4)?
Thanks in advance.
You have an scattered dataset.
interp3does only work if your data points are in meshgrid format read this. The short description of this function isInterpolation for 3-D gridded data in meshgrid formatInstead you can use
griddatawhich works for scattered data read this. The short description isInterpolate 2-D or 3-D scattered data.Example:
Data points:
Interpolated: