linear optimization problem in matlab

Hi, i have written the following function for optimization but i does not show the answer, but keeps displaying the "optimal solution found'.
f=[-10 -2];
a=[1 2;1 -3;-20 2];
b=[20 3 -10];
aeq=[];
beq=[];
lb=[0 0 ];
ub=[];
[X F]=linprog(f,a,b,aeq,beq,lb,ub);
Optimal solution found.

 採用された回答

Bruno Luong
Bruno Luong 2020 年 9 月 2 日

0 投票

Add this to display the solution
X
F

1 件のコメント

ashwin TP
ashwin TP 2020 年 9 月 2 日
that was trivial. i figured out that too. thanks

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

その他の回答 (1 件)

GULZAR
GULZAR 2024 年 3 月 21 日

0 投票

f=[-10 -2];
a=[1 2;1 -3;-20 2];
b=[20 3 -10];
aeq=[];
beq=[];
lb=[0 0];
ub=[];
[X, F]=linprog(f,a,b,aeq,beq,lb,ub);
Optimal solution found.
disp(X)
13.2000 3.4000
disp(F)
-138.8000

カテゴリ

ヘルプ センター および File ExchangeProblem-Based Optimization Setup についてさらに検索

タグ

質問済み:

2020 年 9 月 2 日

回答済み:

2024 年 3 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by