Matlab interpolation of 4D scattered data
1
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); S...