I am running a script, but it is taking much too long so I want to terminate the script. However it has calculated a lot of data which I would ideally not want to throw away. Is there an alternative to ctrl-C
with which you save the internal function variables to the workspace?
Ideally I'm looking for a Matlab keyboard shortcut like ctrl-C
, but if that really can't be done maybe there is a way to do this in the script of my function. Any idea how to let my script react to ctrl-C
as well, or maybe a GUI element which I can cancel and then I save the variables through my script?
Some similar questions I have found, but that don't answer my question:
close/pause
terminate
Different question, similar answer:
dbstop
EDIT:
This question is different because the problem the asker has is different: they want to know where the error is, which in my case Matlab already says. I just want to keep all data from working memory when it happens.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…