Is it possible to have matlab run a default script whenever the execution of an m file stops? And I do not mean the finish.m that runs when quitting matlab, I want to be able to run a script even when I break the execution of a running script by pressing ctrl+C. Would that be possible?
You could use onCleanup
. This popped into my head when you mentioned Ctrl+C action.
Here is the documentation: http://www.mathworks.com/help/matlab/ref/oncleanup.html
Loren has some examples here: http://blogs.mathworks.com/loren/2008/03/10/keeping-things-tidy/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With