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 startup file to project

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


addStartupFile(proj, file)



addStartupFile(proj, file) adds a startup file to the project proj. Startup files automatically run (.m and .p files), load (.mat files), or open (Simulink® models) when you open the project.


collapse all

Open the airframe project and create a project object.

proj = simulinkproject;

Create a new file.

filepath = fullfile(proj.RootFolder, 'new_model.slx')
     save_system('new_model', filepath)

Add the new model to the project.

 projectFile = addFile(proj, filepath)

Automatically open the model when the project opens, by making it a startup file.

addStartupFile(proj, 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 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: ‘models/myModelName.slx’

Compatibility Considerations

expand all

Not recommended starting in R2019a

Introduced in R2017b