필터 지우기
필터 지우기

solving Non Linear optimization problem with fmincon

조회 수: 3 (최근 30일)
Muhammad Kundi
Muhammad Kundi 2019년 10월 13일
답변: Sai Bhargav Avula 2019년 10월 24일
hi,
I am trying to solve the following problem
I have written the following code for this.
objfun = @(x) (x(1)^2 -6*x(1)+x(2)^3 -3*x(2))
A=[1 ,1];
b=[1];
Aeq = [];
beq = [];
lb=[0,0];
ub=[];
x0 = [0.6, 0.4];
[x, fval] = fmincon(objfun, x0, A, b, Aeq, beq, lb, ub)
Is this code correct or are there any mistakes?
Please help.
Thanks
  댓글 수: 2
Fabio Freschi
Fabio Freschi 2019년 10월 13일
Formally it looks correct. In fact, if you run it no error comes up.
Muhammad Kundi
Muhammad Kundi 2019년 10월 14일
thanks..yes no errors comes

댓글을 달려면 로그인하십시오.

채택된 답변

Sai Bhargav Avula
Sai Bhargav Avula 2019년 10월 24일
Hi,
Yes, the code correctly implements the optimization function presented.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by