| Contents | Index |
Convex hull
K = convexHull(DT)
[K AV] = convexHull(DT)
K = convexHull(DT) returns the indices into the array of points DT.X that correspond to the vertices of the convex hull.
[K AV] = convexHull(DT) returns the convex hull and the area or volume bounded by the convex hull.
| DT | Delaunay triangulation. |
| K | If the points lie in 2-D space, K is a column vector of length numf. Otherwise K is a matrix of size numf-by-ndim, numf being the number of facets in the convex hull, and ndim the dimension of the space where the points reside. |
| AV | The area or volume of the convex hull. |
The convex hull of a set of points X is the smallest convex region containing all of the points of X.
Compute the convex hull of a set of random points located within a unit square in 2-D space.
x = rand(10,1) y = rand(10,1) dt = DelaunayTri(x,y) k = convexHull(dt) plot(dt.X(:,1),dt.X(:,2), '.', 'markersize',10); hold on; plot(dt.X(k,1),dt.X(k,2), 'r'); hold off;

Compute the convex hull of a set of random points located within a unit cube in 3-D space, and the volume bounded by the convex hull.
X = rand(25,3) dt = DelaunayTri(X) [ch v] = convexHull(dt) trisurf(ch, dt.X(:,1),dt.X(:,2),dt.X(:,3), 'FaceColor', 'cyan')

convhull | convhulln | DelaunayTri.voronoiDiagram | TriRep

Explore how to use MATLAB to make advancements in engineering and science.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |