This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


(Not recommended) Add shutdown file to project

simulinkproject is not recommended. Use currentProject or openProject instead. For more information, see .


addShutdownFile(proj, file)



addShutdownFile(proj, file) adds a shutdown file to the project proj. When you close the project, it runs the shutdown file automatically. Use the shutdown list to specify executable MATLAB® code to run as the project shuts down.


collapse all

Open the airframe project and create a project object.

proj = simulinkproject;

Specify executable MATLAB code to run as the project shuts down.

     filepath = fullfile('utilities', 'rebuild_s_functions.m');

Automatically run the file when the project closes, by making it a shutdown file.

addShutdownFile(project, filepath);

Input Arguments

collapse all

Project, specified as a project object. Use simulinkproject to create a project object to manipulate a project at the command line.

Path of the MATLAB file to add relative to the project root folder, including the file extension, specified as a character vector. The file must be within the root folder.

Example: ‘utilities/myscript.m’

Compatibility Considerations

expand all

Not recommended starting in R2019a

Introduced in R2017b