Automate Shutdown Tasks with Shortcuts

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.

  1. In the Shortcut Management view, click Create Action Shortcut > Shutdown Script.

  2. Name and save the file.

    The tool adds the new file to the project and sets it to Run at Shutdown.

  3. Right-click the file and select Open.

  4. Write the shortcut script using the Editor.

  5. Click Save.

Configure an existing file as a shortcut to run when you close your project.

  1. 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.

  2. Click the Shortcut Management node.

  3. Right-click the shortcut file and select Set Shortcut Action > Shutdown.

    The Action column displays Run at Shutdown.

    Note:   Shortcuts are included when you commit modified files to source control. Any shutdown shortcuts you create run for all other project users.

To stop a shortcut running at shutdown, change back to a basic shortcut using Set Shortcut Action > None.

Related Examples

More About

Was this topic helpful?