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 shortcut to project

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


shortcut = addShortcut(project,file)



shortcut = addShortcut(project,file) adds a shortcut to the specified file in the project.

To set the shortcut to run at startup or shutdown, use Project. See Automate Startup Tasks.


collapse all

Create a project and get a project object.

project = simulinkproject;

Create a new file.

filepath = fullfile(project.RootFolder, 'new_model.slx')

Add this new model to the project.

projectFile = addFile(project,filepath)

Add a new shortcut to the new model.

shortcut = addShortcut(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 file to add a shortcut to, 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’

Output Arguments

collapse all

Shortcut object containing information about the shortcut.

Compatibility Considerations

expand all

Not recommended starting in R2019a

Introduced in R2017a