1

I have a compiled matlab program that runs as a dos box basically (ie no GUI). Is there a way to get code to execute when someone closes the program? Specifically closing by clicking on the X?

jhlu87
  • 3,999
  • 8
  • 38
  • 48

1 Answers1

0

I suggest to define a cleanup task. This will be executed whenever a function is terminated (by whatever means), so as long as closing the program is not done with a kill -9 command or similar, the code is being run.

Jonas
  • 74,690
  • 10
  • 137
  • 177