addStartupFile - Add startup file to project - MATLAB (original) (raw)
Main Content
Add startup file to project
Syntax
Description
addStartupFile([proj](#mw%5Fdfa6cedf-5c3d-40d8-aa46-6952a09a81f1),[files](#mw%5F5ef6f4d7-adbb-4311-b580-ed181cb4553e))
adds startup files to the specified project. Startup files automatically run (if they are .m
and .p
files), load (if they are.mat
files), or open (if they are Simulink® models) when you open the project.
Examples
Open the Times Table App project. Use currentProject
to create a project object from the currently loaded project.
openExample("matlab/TimesTableProjectExample") proj = currentProject;
Automatically run the Times Table app when the project opens by making therunTheseTests.m
file a startup file.
filepath = fullfile("utilities","runTheseTests.m"); addStartupFile(proj,filepath);
Input Arguments
Project, specified as a matlab.project.Project
object. Use currentProject to create a project object from the currently loaded project.
Path of the shortcut file, including the file extension, specified as a string array or a cell array of character vectors. The files must be within the project root folder. If the file is not a project file, the function adds it to the project.
Version History
Introduced in R2019a
Starting in R2025a, the addStartupFile
function supports adding multiple startup files at the same time.