I would like to create a for loop with start, pause , continue and cancel push buttons on guide.

1 Ansicht (letzte 30 Tage)
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 Kommentare
Jan
Jan am 8 Dez. 2016
Bearbeitet: Jan am 8 Dez. 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".

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Image Analyst
Image Analyst am 8 Dez. 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.

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by