Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: GUI: Stop loops in another callback function
Replies: 3   Last Post: Apr 10, 2013 3:29 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 8
Registered: 2/23/12
GUI: Stop loops in another callback function
Posted: Feb 28, 2012 6:33 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


I have a GUI with some parameters and a start and cancel button. When I press the start button in the callback function of the start button, some calculations are done with loops. When I press the cancel button the calculations done in the start button callback should stop immediately. How can I solve this without using a global variable like this:

function start_callback(...)
global stop
while n<N && ~stop

function cancel_callback(...)
global stop


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum 1994-2015. All Rights Reserved.