MATLAB Answers

0

How to terminate or break the pause function

Asked by Tonghui Zhang on 23 May 2019
Latest activity Answered by Geoff Hayes
on 27 May 2019
Hi all,
I have a question related to pause function. My code is inside a GUI and when I click a button it starts to pause for 100 secondes. I have another quit button when I click on it, the gui will close. My question is that after quiting gui, the pause code is still running. Is there any method to stop it with no errors?
Thanks a lot

  0 Comments

Sign in to comment.

1 Answer

Answer by Geoff Hayes
on 27 May 2019

Tonghui - rather than using a while loop with a pause function to periodically perform a task, use a timer instead so that you can start and stop it at will. See https://www.mathworks.com/matlabcentral/answers/284202-how-to-plot-a-real-time-signal-with-axes-automatically-updating for an example.

  0 Comments

Sign in to comment.