This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Convex hull of polyshape


polyout = convhull(polyin)



polyout = convhull(polyin) returns the convex hull of a polyshape object. polyout is a polyshape object or an array of polyshape objects the same size as polyin.


collapse all

Compute the convex hull of a polygon containing three solid regions.

x1 = [0 1 2];
y1 = [0 1 0];
x2 = [2 3 4];
y2 = [1 2 1];
x3 = [0 0.5 0.5 0];
y3 = [2 2 2.5 2.5];
polyin = polyshape({x1,x2,x3},{y1,y2,y3});
hold on
polyout = convhull(polyin);

Input Arguments

collapse all

Input polyshape, specified as a scalar, vector, matrix, or multidimensional array.

Data Types: polyshape

Introduced in R2017b