Effacer les filtres
Effacer les filtres

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

2 vues (au cours des 30 derniers jours)
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 commentaire
Walter Roberson
Walter Roberson le 10 Nov 2021
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.

Connectez-vous pour commenter.

Réponses (1)

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

Catégories

En savoir plus sur Get Started with Optimization Toolbox dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by