I am trying to use interp3 for my data which can be found at http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid:73338. The file is about 7MB. The data is distributed over an ordered Cartesian grid with uniform intervals. I can successfully use stream3 by adjusting the data for meshgrid compatibility according to the following code using permute function. It works fine. However, when I want to do interpolation, I get an error which says the input data is not a valid meshgrid.
x = permute(x , [2 1 3]); y = permute(y , [2 1 3]); z = permute(z , [2 1 3]); u = permute(u , [2 1 3]); v = permute(v , [2 1 3]); w = permute(w , [2 1 3]); InOut = permute(InOut , [2 1 3]); [ sx, sy, sz ] = meshgrid( -1:1:1, -1:1:1, -1:1:1 ); vertices = stream3( x, y, z, u, v, w, sx(:), sy(:), sz(:) ); val = interp3( x, y, z, InOut, 0, 0, 0 );
The above code stops at the line where I do the interpolation. Could someone help me?
No products are associated with this question.
Play games and win prizes!Learn more