I would like to create a for loop with start, pause , continue and cancel push buttons on guide.
1 view (last 30 days)
Show older comments
START should execute the loop -PAUSE should stop the loop-CONTINUE should resume from where left after pausing-CANCEL should terminate the loop or program
The thing is I could not connect pushbuttons with loop. how to declare variables which will be use in main function and how to call them.
for i=0:100
disp(i);
end
"PushStart" 0 1 2 3 "PushPause"------------- "PushContinue" 4 5 6 7 8---------- "PushStop"---------- terminate
3 Comments
Jan
on 8 Dec 2016
Edited: Jan
on 8 Dec 2016
@Atacan: How did you try it? Please post your code, even if it does not work currently, and ask a specific question. Give us a chance to assist you. E.g. there is simply no "pusbutton" in your code, so how could it be "connected"? Therefore a solution must start with the trivial: "Create a pushbutton".
Answers (1)
Image Analyst
on 8 Dec 2016
See attached button that creates a Go/Stop situation. Press the Go button to start a counting process. Click the Step button to stop it.

0 Comments
See Also
Categories
Find more on Loops and Conditional Statements 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!