Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

convhull - Convex hull

Syntax

K = convhull(x,y)
[K,a] = convhull(...)

Description

K = convhull(x,y) returns indices into the x and y vectors of the points on the convex hull.

K = convhull(x,y,options) specifies a cell array of strings options that were previously used by Qhull. Qhull-specific options are no longer required and are currently ignored.

[K,a] = convhull(...) also returns the area of the convex hull.

convhull uses CGAL, see http://www.cgal.org.

Visualization

Use plot to plot the output of convhull.

Examples

Example 1

xx = -1:.05:1; yy = abs(sqrt(xx));
[x,y] = pol2cart(xx,yy);
k = convhull(x,y);
plot(x(k),y(k),'r-',x,y,'b+')

See Also

DelaunayTri/convexHull, DelaunayTri/voronoiDiagram, convhulln, delaunay, polyarea, voronoi

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS