How to stop a for loop execution from GUI?(From Toolbar stop button)
Show older comments
I have for loop,,I want to to stop this loop from a toolbar button,, Initially I have set a flag "STOP=0",,,and when I press my stop button in tool bar,,I am calling a function,,where "STOP=1" I have written script,,,,But my script is not considering this"STOP" flag,,,please hep me out>...
Accepted Answer
More Answers (1)
Jan
on 4 Apr 2013
0 votes
Each function has its own workspace, such that a variable set in one function is not visible in the other. A solution is to set a flag e.g. in the UserData of a figure or any other UI-object. This flag can be checked from inside the loop also.
Categories
Find more on MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!