vertex computes the vertices of a polytopic constraint.
V = vertex(Constraint,[x])
The typical use is as follows
x = sdpvar(2,1); B = [-1 <= x <= 1, sum(x) <= 3/2]; plot(B);hold on v = vertex(B); plot(v(1,:),v(2,:),'k*')
Models often live in a higher-dimensional space than expected due to internal modelling. For instance, the following polytope in 3D is represented in a 6D space in order to represent the absolute values. To find the vertices of the polytope in our original space, we give a second argument to explain that we only want the vertices projected onto our original space.
x = sdpvar(3,1); P = [-1 <= x <= 1, sum(abs(x)) <= 1] plot(P,x);hold on v = vertex(P,x); plot3(v(1,:),v(2,:),v(3,:),'y*');
Note that all projected vertices are returned, not just the convex hull in the projected dimension.
Very rudimentary implementation only intended for illustration and academic examples.