Function Reference
— Function File: H = convhull (x, y)
— Function File: H = convhull (x, y, opt)

Returns the index vector to the points of the enclosing convex hull. The data points are defined by the x and y vectors.

A third optional argument, which must be a string, contains extra options passed to the underlying qhull command. See the documentation for the Qhull library for details.

See also: delaunay convhulln

Demonstration 1

The following code

 x = -3:0.05:3;
 y = abs (sin (x));
 k = convhull (x, y);
 plot (x(k),y(k),'r-',x,y,'b+');
 axis ([-3.05, 3.05, -0.05, 1.05]);

Produces the following figure