fminunc not to stop even if it does not converge in one or more of 1000 replications of a simulation

1 vue (au cours des 30 derniers jours)
Hi, I have a simulation of 1000 replications including two optimizations each using fminunc. In some of the cases, one of the optimizations does not converge and the code stops. I want to modify the code so that it continues even if it does not converge for some replications. How can I do this?

Réponse acceptée

Alan Weiss
Alan Weiss le 3 Juil 2013
I am not sure what you are asking. Do you want fminunc to continue to iterate even if it stopped without converging? If so, please let us see the exit message so we can understand why fminunc stopped. Also, you might get better advice if you show us your options and the call to fminunc.
If, however, you are looking for programming advice on how to handle conditions when a subroutine fails, then I think you simply need to unedrstand try/catch or other exception handling.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

Plus de réponses (0)

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by