fminbnd fails to converge with exitflag=1
Mostrar comentarios más antiguos
I'm trying to use fminbnd to find the extrema of a function, but I'm having an issue with the tolerance. Here is a simple example:
>> [x,fval,exitflag]=fminbnd(@cos,3,4,optimset('TolX',1e-12))
x = 3.1416
fval = -1
exitflag = 1
>> x-pi
ans = 4.3792e-10
The exitflag indicates that fminbnd converged within the specified tolerance. So why is x-pi>TolX???
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Just for fun en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!