linear optimization problem in matlab

1 vue (au cours des 30 derniers jours)
ashwin TP
ashwin TP le 2 Sep 2020
Réponse apportée : GULZAR le 21 Mar 2024
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.

Réponse acceptée

Bruno Luong
Bruno Luong le 2 Sep 2020
Add this to display the solution
X
F
  1 commentaire
ashwin TP
ashwin TP le 2 Sep 2020
that was trivial. i figured out that too. thanks

Connectez-vous pour commenter.

Plus de réponses (1)

GULZAR
GULZAR le 21 Mar 2024
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

Catégories

En savoir plus sur Get Started with Optimization Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by