- the function pause, in which case the answer is "not easily".
- debugging features which stop code evaluation on error, e.g. dbstop, in which case the answer is "yes".
Is it possible to save a workspace when a program is paused without it ending the program?
23 views (last 30 days)
Show older comments
I have been running a program for the last few days that I realized will give me an error eventually. However it won't be an issue if I can save the workspace before that happens.
I know that trying to save a function or script while a program is running will make the program quit. So I don't want to do that here, especially if it will not save the workspace.
I also currently have pausing at errors enabled. So will that pause without terminating the workspace and let me save it?
1 Comment
Stephen23
on 23 May 2020
It is unclear what you actually mean by "pause":
Answers (1)
Star Strider
on 23 May 2020
See: How to save data from Genetic Algorithm in case MATLAB crashes? for an illustration of one way to save the relevant variables in (what appears to be) a similar context.
4 Comments
Star Strider
on 23 May 2020
The function that I implemented to record the current variables in that Answer is just another function call. It does not pause or interrupt anything, it simply executes and then passes control back to the calling script.
See Also
Categories
Find more on Whos 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!