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 =
[]

 採用された回答

Matt J
Matt J 2022 年 1 月 2 日
編集済み: Matt J 2022 年 1 月 2 日

0 投票

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

1 件のコメント

Kristian  Salma
Kristian Salma 2022 年 1 月 2 日
Thank you soo Matt, have a nice day. You saved me.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Mathematics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by