In Simulink® Project, shutdown shortcuts help you clean up the environment for the current project when you close it. Shutdown shortcuts should undo the settings applied in startup shortcuts. You can view an example in the sldemo_slproject_airframe project.
Create a new shutdown shortcut file.
In the Shortcut Management view, click Create Action Shortcut > Shutdown Script.
Name and save the file.
The tool adds the new file to the project and sets it to Run at Shutdown.
Right-click the file and select Open.
Write the shortcut script using the Editor.
Configure an existing file as a shortcut to run when you close your project.
Right-click the file in the All Files or Project Files view and select Create Shortcut > General, or if you have created a shortcut group you want to use, then select Create Shortcut > GroupName. You can change shortcut group later.
Click the Shortcut Management node.
Right-click the shortcut file and select Set Shortcut Action > Shutdown.
The Action column displays Run at Shutdown.
To stop a shortcut running at shutdown, change back to a basic shortcut using Set Shortcut Action > None.