Main Content

addStartupFile

Add startup file to project

Description

example

addStartupFile(proj,file)添加一个启动文件specified project. Startup files automatically run (if they are.mand.pfiles), load (if they are.matfiles), or open (if they are Simulink®models) when you open the project.

Examples

collapse all

Open the Times Table App project. UsecurrentProjectto create a project object from the currently loaded project.

matlab.project.example.timesTable proj = currentProject;

Automatically run the Times Table app when the project opens by making therunTheseTests.mfile a startup file.

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

Input Arguments

collapse all

Project, specified as amatlab.project.Projectobject. UsecurrentProjectto 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.

Introduced in R2019a