Create rectangular mesh from non-rectangular mesh and interpolate
Show older comments
Hey Everyone
I have a non-rectangular grid in 3D space in which each point in 3D space is assigned a value (Basically a CFD mesh). I would like to transport this to a rectangular mesh because using MATLAB's 'slices' would be very beneficial to visualize the flow. To visualized this I basically have a pyramid to start with, and need to mesh it into a rectangle that encompasses it all.
My 3D data is broken into X,Y,Z, and MAG. The nature of these are what you'd expect, each a 3D array and they are formatted properly, I've checked them all. What I'd like to do is interpolate the MAG data into a mesh grid that goes from min(X)-max(X) and same for Y and Z. Here is what I have so far.
[Xm,Ym,Zm]=meshgrid(min(X(:):1:max(X(:)),min(Y(:)):1:max(Y(:)),min(Z(:)):1:max(Z(:)));
NEWMAG=interp3(X,Y,Z,MAG,Xm,Ym,Zm);
Unfortunately I cannot even get past this because I get an error stating this is an invalid mesh for the use of interp3 and I cant figure out why.
Any help would be great.
Thanks
Accepted Answer
More Answers (0)
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!