Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Function that executes on GUI closing in matlab

I am creating a GUI in matlab using guide. It's non-blocking (not calling uiwait). When the gui window is closed, I would like to execute some clean up code.

Is there an gui_ClosingFcn callback I should define in analogy to the gui_OpeningFcn template that guide creates for me?

like image 432
Marc Avatar asked Jun 08 '10 19:06

Marc


People also ask

Does Matlab function need end?

If a file contains a function with one or more nested functions, then every function in the file must be terminated with end . If a script contains one or more local functions, then every function in the file must be terminated with end .


2 Answers

Figure windows have a 'DeleteFcn' property, which defines a callback function that will run when the window is closed/deleted. You could potentially use that to do your clean-up.

like image 72
gnovice Avatar answered Oct 19 '22 02:10

gnovice


Figure windows have a CloseRequestFcn property, which defines a callback function that will run when the window is closed (before deleting the window). enter image description here

like image 20
Dariush Jafari Avatar answered Oct 19 '22 01:10

Dariush Jafari