How to interrupt the optimisation routine (from Optimisation Toolbox)

Hello,
I wanted to create a GUI button that would exit the optimisation routine by setting STOP parameter of the output function to 1. However, whatever I do during the optimisation (after running ex. fmincon function), it will have effect only after the solver finishes. Can I somehow make an interruption that would execute while Matlab is 'busy' with optimisation? Is there any way of stopping the optimisation externally, apart from ctrl+c ?
I've seen some ideas with using try-catch procedure, but I'd rather avoid this to not change and complicate my code that much at a current level...

回答 (1 件)

Alan Weiss
Alan Weiss 2016 年 7 月 18 日
編集済み: Alan Weiss 2016 年 7 月 18 日

0 投票

All plot functions have this as built-in functionality. Perhaps the simplest thing to do is to write a custom plot function, which will automatically create a GUI button to stop an optimization.
Alan Weiss
MATLAB mathematical toolbox documentation

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

質問済み:

2016 年 7 月 12 日

編集済み:

2016 年 7 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by