linprog. Alsway the answer is 0.

1 回表示 (過去 30 日間)
marios semer
marios semer 2020 年 12 月 10 日
回答済み: Matt J 2020 年 12 月 10 日
Whatever arrays i use with linprog the only answer it gives me is 0.
Here is an example code:
clc
f = [ 12 ; 7 ];
b = [ 10.000 ; 16.000 ; 0 ; 0];
A = [ 2 , 1 ; 3 , 2 ; -1 , 0 ; 0 , -1 ];
x = linprog(f,A,b);

回答 (1 件)

Matt J
Matt J 2020 年 12 月 10 日
Whatever arrays i use with linprog the only answer it gives me is 0.
Not these arrays. I'm sure we can come up with others as well.
f = [ 12 ; 7 ];
b = [ 10.000 ; 16.000 ; 1 ; 1];
A = [ 2 , 1 ; 3 , 2 ; -1 , 0 ; 0 , -1 ];
x = linprog(f,A,b)
Optimal solution found.
x = 2×1
-1.0000 -1.0000

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by