Find unknowns from inequations

Hello community
I'm looking for help, please.
How can I find unknowns from inequations?
Here is an example:
24+x1<= 50
24+x2<= 206
x2-x1<=245
-x2+x1<=361
I need x1 and x2

 Accepted Answer

KSSV
KSSV on 31 Jan 2023
Read about linprog

7 Comments

For linprog i think we must have an objective function,,, but here we dont have it
Torsten
Torsten on 31 Jan 2023
Edited: Torsten on 31 Jan 2023
What is your final aim ?
Do you only want to get a single point that satisfies all constraints ?
Do you want to graph the feasible region in 2d as a polygon ? Because there are many (x1,x2) pairs that "solve" your system of inequalities in general.
For the latter, you could use
I want to get just single point x1 and x2
f = [0 0];
ub = [50-24,206-24];
A = [-1 1;1 -1];
b = [245;361];
sol = linprog(f,A,b,[],[],[],ub)
Optimal solution found.
sol = 2×1
26 26
Thanks ,,, Plz can you re-write the inequalities that you have solved through this code
These are the ones from your original question above.
Thank you so much for your help

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!