Specifications

Launching a Dialog to Confirm an Operation
5-17
Select Edit CloseRequestFcn from the context menu. GUIDE automatically
places a new subfunction in the application M-file for the GUI and changes the
figure’s
CloseRequesFcn property to execute this subfunction as the close
request function.
The Redefined Close Request Function
The GUIs close request function simply calls the Close button’s callback.
function varargout = figure1_CloseRequestFcn(h,eventdata,handles,varargin)
pushbutton1_Callback(h,eventdata,handles)