stop fmincon if encounter warning about rank
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I'm running fmincon using the sqp algorithm to run a montecarlo.
Sometimes (a couple out of a hundred) it encounters a matrix close to singluar and gets caught.
Is there a way to stop the optimizer and move on to the next with an exitflag that will let me know it did so?
I tried interior point, but after 10000 maxiter it didn't get close to the minimum that sqp was finding, so seems like sqp is better for this problem if I can find a way to cancel the optimization and move on if it encounters the warning.
Thanks for any tips.
0 Kommentare
Antworten (1)
Matt J
am 6 Feb. 2014
Bearbeitet: Matt J
am 6 Feb. 2014
You can define your own stopping conditions using the OutputFcn option, see here
I don't think it offers a way to control the native exitflag output argument, but you can send the flag to a global variable, or use nested functions that share variables.
9 Kommentare
Matt J
am 8 Feb. 2014
Like I said, the way you are doing it now seems fine, except that tstart would have to be made persistent, and reset to 0 at an appropriate point.
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!