Plotting the area which is satisfied by some inequalities

7 views (last 30 days)
How can I plot the area which is satisfied by the constraints:
x1 + x2 >= 1
x1 - x2 <= 0
3*x1 + x2 <= 6
x1, x2 >= 0

Answers (1)

John D'Errico
John D'Errico on 25 Aug 2015
I recall a code named plotregion , on the file exchange.
  2 Comments
Ryan Shrott
Ryan Shrott on 25 Aug 2015
That only works if you know the region a priori. In my case, the region is defined in terms of constraints.
John D'Errico
John D'Errico on 27 Aug 2015
Edited: John D'Errico on 27 Aug 2015
What are you talking about? You pass in the constraints to plotregion as a matrix of inequality constraints and sets of lower and upper bounds. That is EXACTLY what you have. I think you need to look at plotregion. Read the help for it.
All I can imagine from your statement here is that you don't know how to write linear inequality constraints in a matrix form. So, are you really asking how one can write those equations in matrix form (i.e., linear algebra 101?)

Sign in to comment.

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!