Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

라이선스가 부여된 사용자만 번역 문서를 볼 수 있습니다. 번역 문서를 보려면 로그인하십시오.

Exit MATLAB

Ways to Exit

At any time, do one of the following:

  • Click the Close box in the MATLAB® desktop.

  • Click on the left side of the desktop title bar and select Close.

  • Type quit or exit at the command prompt.

MATLAB closes after:

Confirm Exiting

To set a preference that displays a confirmation dialog box when you exit:

  1. On the Home tab, in the Environment section, click Preferences.

  2. Select MATLAB > General > Confirmation Dialogs.

  3. Select the Confirm before exiting MATLAB check box and click OK.

MATLAB then displays the following dialog box when you exit.

You can also display your own exit confirmation dialog box using a finish.m script, as described in the following section.

Running a Script When Exiting

When MATLAB exits, it runs the script finish.m, if finish.m exists in the current folder or anywhere on the search path. You create the file finish.m containing statements such as saving the workspace or displaying a confirmation dialog box. There are two sample files in matlabroot/toolbox/local that you can use as the basis for your own finish.m file:

  • finishsav.m — Includes a save function so the workspace is saved to a MAT-file.

  • finishdlg.m — Displays a confirmation dialog box that allows you to cancel quitting.

See Also

| |

More About

Was this topic helpful?