Main Content

addShutdownFile

Add shutdown file to project

Description

addShutdownFile(proj,file) adds a shutdown file to the specified project. When you close the project, the project runs the shutdown file automatically.

example

Examples

collapse all

Open the Times Table App project. Use currentProject to create a project object from the currently loaded project.

openExample("matlab/TimesTableProjectExample")
proj = currentProject;

Specify executable MATLAB® code to run as the project shuts down. Automatically run the file when the project closes, by making it a shutdown file.

filepath = fullfile("utilities","runTheseTests.m");
addShutdownFile(proj,filepath);

Input Arguments

collapse all

Project, specified as a matlab.project.Project object. Use currentProject to create a project object from the currently loaded project.

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

Version History

Introduced in R2019a