MATLAB: How to enable a confirmation dialog to appear when I attempt to close MATLAB

closedialogMATLABpreferencessettingwarning

I would like a confirmation to appear prior to closing MATLAB to protect against accidentally closing MATLAB and losing valuable work.

Best Answer

This enhancement has been applied in MATLAB 7.0.4 (R14SP2).
For previous releases, to enable the confirmation dialog to appear upon closing MATLAB perform the following steps:
1. Select "File -> Preferences..."
2. Select "Confirmation Dialogs" in the tree browser on the left
3. Check the checkbox next to "Confirm before exiting MATLAB"
4. Click "Apply"
5. Click "OK"