This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.


Compute the convex hull of a set of points

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.




plot::hull computes the convex hull of a list of points in any dimension, i.e., the smallest convex region containing all the points. Such a region is bounded by simplices (straight lines in the plane, triangles in 3D) and it is these simplices which plot::hull returns.

Environment Interactions

Although plot::hull accepts and returns floating point values, the actual computations take place in hardware floating points and are therefore not affected by the value of DIGITS.


Example 1

We generate a list of random points and compute their convex hull:

X := stats::uniformRandom(0, 20):
l := [[X(), X()] $ i = 1..10]:
h := plot::hull(l):

The convex hull is returned as lists of lists, as accepted by plot::Polygon2d:


     plot::Polygon2d(t) $ t in h,
     Closed, PointSize=2)

Example 2

The convex hull of a list of points in 3D is also easy to visualize:

l := [[x, y, z] $ y = z..x $ z = -x..x $ x = 0..10]:
h := plot::hull(l):
plot(plot::PointList3d(l, PointSize=1),
     plot::Polygon3d(t) $ t in h,
     Closed, Filled, FillColor=RGB::LightOrange.[0.6])



A list of points, which are given as lists of real values

Return Values

List of simplices of dimension one less than that of the points in L, given as lists of lists of floating-point values.


plot::hull uses qhull from the Geometry Center of the University of Minnesota, see

Was this topic helpful?