toggle button to stop a for loop not working
Show older comments
I am trying to exit a for loop using toggle button, created using guide. Toggle button is initially called 'Run'. The iteration starts when 'Run' is hit and the toggle button string changes to 'Stop'. However, iteration continues after 'Stop' is hit (in the screenshot, 'Stop' is hit at i=2). I used dbstack to check the Run callbacks. Am I missing something obvious?? Any help would be appreciated. Here's the code snippet and the command window screenshot-

Accepted Answer
More Answers (0)
Categories
Find more on Function Creation 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!