How to pass iteration number and f-count to fmincon
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Aleksander Marek
le 22 Juil 2016
Réponse apportée : Aleksander Marek
le 25 Juil 2016
Hi,
I was wondering if there is any way to pass current number of iteration and number of function evaluations to my objective function using fmincon function. I need that to selectively update some internal parameter if the solver struggles with finding solution (e.g. if it calculates more than 1 finite difference for each parameter within a single iteration)
Cheers, Aleksander
0 commentaires
Réponse acceptée
Alan Weiss
le 22 Juil 2016
If you make your objective function explicitly depend on a parameter vector v, then you can make a nested function where v gets updated by a custom output function. I have never tried to do this, but MATLAB is nothing if not flexible, you can generally do whatever you want.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
0 commentaires
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Solver Outputs and Iterative Display 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!