MATLAB Plot $P = \{x|Ax\leq b\}$

212 Views Asked by At

So I am having this trouble with plotting my Polyhedral Set defined as $$P = \{x|Ax\leq b\}$$ The thing is I want to plot it in MATLAB. Let's say my matrix $A$ is $A = [1\ 1 \ ;\ 1\ -1;-5\ 1]$, and my vector $b$ is $b = [0 \ 2 \ 0]$.

How do I plot this polygon in $2D$?

Thanks!

1

There are 1 best solutions below

0
On

I had good experience with plotregion (https://www.mathworks.com/matlabcentral/fileexchange/9261-plot-2d-3d-region) some years ago. It supports 2d and 3d plots and expects the polyhedral set in the form $Ax \geq b$. Hence, use $\mathtt{plotregion(-A,-b)}$ in your particular case.