How can I process an external System Signal in a Matlab executable

5 次查看(过去 30 天)
Hello,
I'm creating a Matlab executable via mcc to run a tool on a cluster (in a linux environment). I have a situation, where it is necessary to be able to checkpoint my computation and graceously exit when a given external signal is received. I saw that there is the onCleanup function, which works nicely within Matlab. However when the code is compiled as an executable onCleanup does not react to any external signals. Regardless on whether I send a signal to the process via kill or just press ctrl+c in the terminal running the code it just terminates without executing the cleanup. Unfortunately I haven't found any other method to handle external events (maybe I just looked in the wrong places).
Could anyone tell me whether there is a way to handle external signals in a matlab executable?

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Compiler 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by