How to stop a running script with a push-button and return best solution so far to GUI surface?
Show older comments
Hi people,
i implemented a GUI with GUIDE that executes an algorithm by pushing a PUSH-Button. The algorithm tends to produce better solutions the longer it runs. The call of the algorithm looks like
[solution_value]=heuristic.m
Now i would like the user to have the possibility to stop the running algorithm and to return the best solution value "solution_value" that was calculated so far! so i dont want to wait until the algorithm is fully finished but stop the execution and return the current value of the return variable... The whole algorithm runs in a while loop, so it would be enough to make the algorithm jump out of the while loop...After that the return variable is assigned in the algorithm and can be given back to the GUI as usual..
How can i manage that?
Thank you very much and best regards, John
1 Comment
John
on 2 Jan 2016
Answers (0)
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!