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

3 次查看(过去 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 个)

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