Pause a long MATLAB run with a simple click.

Version 1.2.0.0 (730 Bytes) von Roni Peer
A simple way to pause a long simulation, to check progress, without expensive breakpoints or checks
3,1K Downloads
Aktualisiert 19 Apr 2016

Lizenz anzeigen

Sometimes you create MATLAB functions that take ages to run (more than 10 minutes). You want to be able to pause every now and then, by clicking a "CTRL+P" or something like that, make sure all the values are ok, and then continue running from the same spot. If you tried "CTRL+C", you know it's not working well. So, untill such an option will exist, I wrote a simple example to show how you can use a PushButton and a guarded breakpoint to do so.
Run the file, by executing "myFunc(1)".
You will see a button pop up. Every time you press it, it will halt the function's execution and allow you to view the progress of the code.
Pressing F5 will continue the run.
You can use this as a template for your specific needs, simply modify and use.
PLEASE NOTE: In MATLAB version R2016a this feature is already a part of the editor, so you don't really need this submission anymore. Hooray for MathWorks development team for adding this feature!

Zitieren als

Roni Peer (2024). Pause a long MATLAB run with a simple click. (https://www.mathworks.com/matlabcentral/fileexchange/35114-pause-a-long-matlab-run-with-a-simple-click), MATLAB Central File Exchange. Abgerufen .

Kompatibilität der MATLAB-Version
Erstellt mit R2011b
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Debugging and Analysis finden Sie in Help Center und MATLAB Answers
Quellenangaben

Inspiriert: Soft interrupting of long computer runs

Community Treasure Hunt

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

Start Hunting!
Version Veröffentlicht Versionshinweise
1.2.0.0

- Changed the "clear(h)" command to "close(h)" in order to close the button when the simulation finishes.
- Updated the description, to reflect development effort that were added in R2016a version.

1.1.0.0

Removed unnecessary FLAG checks.

1.0.0.0