When finding the max value of a function. How can I get the most accuarate value?

조회 수: 2 (최근 30일)
We got asked to find the max value of a function using "fminbnd", got that part, the closest to the real value gets rewarded. How do I know if I could be closer?
x=-10:0.01:10;
options1=optimset('TolFun',1e-7);
[xa,fval1] = fminbnd(fneg,x1,x2,options1);
  댓글 수: 1
Walter Roberson
Walter Roberson 2021년 11월 10일
You might want to reduce the minimum step size, or adjust some of the other tolerances so that it tries harder to find the maximum.

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

답변 (1개)

Abhishek Kolla
Abhishek Kolla 2021년 11월 10일
Hi ,
fminbnd function returns the point where the function takes minimum value in the given interval and fval1 need not be maximum value.

카테고리

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

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by