How to optimize a function?

조회 수: 4 (최근 30일)
Ammy
Ammy 2018년 5월 14일
댓글: KALYAN ACHARJYA 2018년 5월 14일
f(x)=x^2+2x-3
x belong to [0,20]
i- How can I optimize the function in matlab?
  댓글 수: 3
Ammy
Ammy 2018년 5월 14일
How to maximize a function, or how to minimize a function, or in other words on which x value the function gives maximum or minimum value.
Torsten
Torsten 2018년 5월 14일
Use "fmincon" with the bound constraints x>=0 and x<=20.

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

채택된 답변

Torsten
Torsten 2018년 5월 14일
x1=0;
x2=20;
fun=@(x)x^2+2x-3;
x = fminbnd(fun,x1,x2)
  댓글 수: 1
KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 5월 14일
fun=@(x)x^2+2*x-3;

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Nonlinear Optimization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by