필터 지우기
필터 지우기

linear optimization problem in matlab

조회 수: 1 (최근 30일)
ashwin TP
ashwin TP 2020년 9월 2일
답변: GULZAR 2024년 3월 21일
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일
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일
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

카테고리

Help CenterFile Exchange에서 Problem-Based Optimization Setup에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by