check if close button of matlab windows clicked(x button)

i am searching a way that check if any close button of matlab windows clicked for example close button of neural network or close button of figures, thank you for help
if(%close button clicked)
do some thing
else
do another thing

Categories

Asked:

on 29 Dec 2017

Answered:

on 29 Dec 2017

Community Treasure Hunt

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

Start Hunting!