Help setting time limit on fzero

5 vues (au cours des 30 derniers jours)
Eric
Eric le 17 Mar 2012
I need to set a time limit or a max number of iterations on the premade function, fzero.m. Can anyone please help me with this?
Thanks, Eric

Réponses (1)

Walter Roberson
Walter Roberson le 17 Mar 2012
Use optimset() to create a parameters structure that sets an output function. The output function should check the iterations or the time elapsed and return true if the optimization should terminate.
  1 commentaire
Eric
Eric le 17 Mar 2012
Thanks for your help. I've been looking into this, but I can't figure out how to pass the starting time into the output function. Would I put t0=clock; at the top of fzero.m?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Problem-Based Optimization Setup dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by