<commit_before>---
category: command
excerpt: "Perform vertex enumeration of polytopic constraint"
title: vertex
tags: [Polytopes]
date: '2021-05-17'
sidebar:
  nav: "commands"
---

[vertex](/command/vertex) computes the vertices of a polytopic constraint.

### Syntax

````matlab
V = vertex(Constraint)
````

### Example
The typical use is as follows

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


### Comments

Very rudimentary implementation only intended for illustration and academic examples.<commit_msg>Update 2021-05-17-vertex.md<commit_after>---
category: command
excerpt: "Perform vertex enumeration of polytopic constraint"
title: vertex
tags: [Polytopes]
date: '2021-05-17'
sidebar:
  nav: "commands"
---

[vertex](/command/vertex) computes the vertices of a polytopic constraint.

### Syntax

````matlab
V = vertex(Constraint,[x])
````

### Example
The typical use is as follows

````matlab
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 3D is represented in a 6D space in order to model the absolute values. To find the vertices of the polytope, we give a second argument to explain that we only want the vertices projected onto our original space.

````matlab
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*');
````



### Comments

Very rudimentary implementation only intended for illustration and academic examples.
{'fraction_non_alphanumeric': 0.16626936829559, 'fraction_numerical': 0.030393325387365912, 'mean_word_length': 4.789655172413793, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3381272', 'n_tokens_mistral': 611, 'n_tokens_neox': 567, 'n_words': 197}