Linear programming, interested in only 1 variable

1 回表示 (過去 30 日間)
Richárd Tóth
Richárd Tóth 2019 年 9 月 16 日
コメント済み: Richárd Tóth 2019 年 9 月 16 日
Hello
It might be a stupid question, but I'm a bit confused. You have inequalities, want to find the smallest for example value.
So you need to solve s.t. . Calling a solver will give a result with
Is this the correct way to solve it? variable values are meaningless

採用された回答

Bruno Luong
Bruno Luong 2019 年 9 月 16 日
編集済み: Bruno Luong 2019 年 9 月 16 日
If you want to minimize x1 under A*x <= b
f = zeros(size(x));
f(1) = 1;
x = linprog(f, A, b);
(x2,...,xn) is not meaningless, it's the associate components such that your constraint A*x <= b is satisfied.
Imagine you want to find most left corner of a 2D triangle.
It can be written as
A*x <= b
with x is 2 x 1, A is 3 x 2, b and 3 x 1.
the LINPROG returns you (x1,x2) coordinates of the left most corner (minimize x1) even if you ignore x2 it's still the ordinate of the corner.
  1 件のコメント
Richárd Tóth
Richárd Tóth 2019 年 9 月 16 日
all clear now thanks

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by