Query regarding 3D mesh-grid

3 views (last 30 days)
Ampi
Ampi on 30 Oct 2012
**Hello, I have a question regarding 3D meshes. Say i have plotted a meshgrid using the following command:-
x=rand(1000,1)-1;
y=rand(size(x))-1;
z=sin(2*(x.^2+y.^2));
[xx,yy]=meshgrid(linspace(-1,1,32));
griddata(x,y,z,xx,yy);
My question is what is the matlab command except trisurf,patch that could be used to display/plot particularly the vertices,triangles and polygons that make up this mesh? Any help regarding this question would be appreciable.*___

Answers (1)

Sean de Wolski
Sean de Wolski on 30 Oct 2012
You don't know these vertices! Is vertex 1 connected to vertex 47 or 598 or 32 and 981? You need to come up wiht a way to determine these polygons.
A Delaunay Triangulation is one method of doing this, i.e. it has a bunch of constraints, vertices who meet these constraints with one another are used to form triangles.
Delaunay triangulation may work for you in which case you could use triplot/trisurf etc.
doc DelaunayTri

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!