MATLAB Answers

Stop and Continue Iterations

20 views (last 30 days)
Kiran Sagar
Kiran Sagar on 8 Jul 2016
Commented: Steven Lord on 10 Jul 2016
I am running a loop as follows:
tol = 1e-6;
while err < tol
% code
disp(tol)
end
During runtime, I decide to stop and check something, and continue the running the program again. I can do this using Ctrl+C, but the program terminates inside the loop, which is undesirable. Is it possible to stop the iterations and continue again in some other way.
  3 Comments
Kiran Sagar
Kiran Sagar on 10 Jul 2016
@Geoff, I wouldn't be changing the variables, I will plot a few graphs to check if the progress is correct.

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 8 Jul 2016
Click the pause button on the tool ribbon, next to the Run button. It looks like the pause button on media players, like two vertical bars.
  3 Comments
Steven Lord
Steven Lord on 10 Jul 2016
Instead of leaving that middle line empty except for a semicolon, call keyboard on it.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by