Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

addFile

Add file to Simulink Project

Syntax

addFile(proj,file)

Description

example

addFile(proj,file) adds a file to the project proj.

Examples

collapse all

Open the airframe project and create a project object.

sldemo_slproject_airframe
proj = simulinkproject;

Remove a file.

removeFile(proj,'models/AnalogControl.mdl')

Add the file back to the project.

addFile(proj,'models/AnalogControl.mdl');

Create and save a new model.

new_system('mymodel');
save_system('mymodel');

Add the new file to the project and return a project file object.

newPrjFile = addFile(proj,'mymodel.slx');

Use the project file object to manipulate the file, for example, adding a label.

addLabel(newPrjFile, 'Classification', 'Design')

Input Arguments

collapse all

Project, specified as a project object. Use simulinkproject to create a project object to manipulate a Simulink® 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'

Introduced in R2013a

Was this topic helpful?