Solution of Linear Programming Problems with Matlab

Hi, have a nice day to everyone,
I have an issue with solve this Solution can you please help me why l get Problem is unbounded.
f=[-3 -8 3];
b=[27.3,20.5,19];
A=[11,1,6;1,11,1;0,1,0];
[x,fmin] = linprog(f,A,b)
Problem is unbounded.
x =
[]
fmin =
[]

 Risposta accettata

Matt J
Matt J il 2 Gen 2022
Modificato: Matt J il 2 Gen 2022
In addition to not entering the positivity constraints x(i)>=0 and mis-typing f, you entered <= constraints instead of >= constraints.
f=[3 -8 3];
A=-[11,1,6;
1,11,1];
b=-[27.3,20.5];
lb=[0,0,0];
ub=[inf,19,inf];
[x,fmin] = linprog(f,A,b,[],[],lb,ub)
Optimal solution found.
x = 3×1
0.7545 19.0000 0
fmin = -149.7364

Più risposte (0)

Categorie

Scopri di più su MATLAB in Centro assistenza e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by