# Compute the intersection of convex sets in Matlab

I'm aware of a Matlab function which take a set of point as an input and select the points which compose the convex hull.

Exemples from Mathworks website :

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*')

Now, my question is : does there exists a Matlab function or what could be the method to follow in order to compute the intersection of two convex sets defined by the set of points of their convex hull ?

• I don't understand. Do you want the intersection of two sets, or the convex hull of two sets? – David Ketcheson Apr 16 '15 at 12:57
• The intersection of the two sets. – Tanj Apr 16 '15 at 13:18

Let the $x$-coordinates for the points in the convex hull of the first convex region be stored in the array x1, and let the $y$-coordinates of those same points be stored in the array y1. Let the arrays x2 and y2 store analogous information for the second convex region.