fminunc not to stop even if it does not converge in one or more of 1000 replications of a simulation
1 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
采纳的回答
Alan Weiss
2013-7-3
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
更多回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!