MATLAB: How to close all open scripts in the Editor window

closeeditorMATLABscripts

How do I close all open scripts in the Editor window?

Best Answer

There are 2 ways to close all open scripts in the Editor window:
1. Close all scripts in the Editor window programmatically:
If this is the case, you can use the following command to get the handle of all open scripts in Editor and then close them:
>> closeNoPrompt(matlab.desktop.editor.getAll);
The command is using the MATLAB Editor API. You can learn more about the API by typing the following into your command window:
>> doc matlab.desktop.editor
2. Close all scripts open in the Editor window via mouse:
This can be done by clicking the cross button on the top right of the Editor window.
Here is a screenshot indicating the location of this button: