polytope

polytope either converts a set of vertices to a set defining a polytope (in a lifted space), or converts a polytopic set to an MPT polytope

Syntax

P = polytope(v,x)
P = polytope(M)

Example

The native YALMIP use is for defing a polytope \(x = \sum_{i=1}^N \lambda_i v_i, \lambda \geq 0, \sum_{i=1}^N \lambda_i = 1\) from a set of vertices \( v_i\).

v = randn(2,10);
x = sdpvar(2,1);
P = polytope(v,x)

The opeprator does not perform any convex hull computation to reduce the numer of vertices. Note also that the polytope is defined in the \(x,\lambda\)-space. Hence, if you want plot it, you are most likely interested in the projection to \(x\)

plot(P,x)

The command also serves as the interface between YALMIP objects and MPT objects, allow us to convert objects. To generate a polytopic MPT object, simply apply the operator on a purely linear object.

x = sdpvar(2,1);
P = polytope([-1 <= x <= 1]);