MATLAB execution break problem
13 views (last 30 days)
Show older comments
I have started running a script on MATLAB that takes days to finish. Usually, if I changed my mind and I don't want wait for it to finish and I get content with the intermediate results, I highlight the command window and press Ctrl-C to break the code.
Now, I have run MATLAB. But its desktop got kinda stuck in the background. When I try to restore the desktop from the toolbar, it does not restore. But I know from the task manager that the process is running and is consuming Memory and CPU performance. So, I am kinda stuck. I don't want to kill the process because I need the intermediate values in the workspace, and I can't open the desktop to break the code using ctrl-c.
Is there any solution? For example, is there any command that can be used in the command prompt to act as ctrl-c for MATLAB?
I am using MATLAB R2012b and Windows 8.
0 Comments
Answers (1)
Image Analyst
on 14 Apr 2015
Use a GUI and have a checkbox that says "Finish Now". The users will be able to click it even though your process is running. At the end of your loop, check the checkbox state, and if it's checked, exit gracefully. This is much better than halting your code abruptly with the Control-c sledge hammer which leaves your variables and final execution line of code in an state of uncertainty.
0 Comments
See Also
Categories
Find more on Startup and Shutdown 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!