Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running a default script in MATLAB whenever an m file execution stops

Tags:

matlab

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?

like image 460
user13267 Avatar asked Nov 13 '22 17:11

user13267


1 Answers

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/

like image 87
HebeleHododo Avatar answered Nov 15 '22 07:11

HebeleHododo