addFile

Add file to Simulink Project

Syntax

Description

example

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

Examples

expand all

Add Files to a Project

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.

addFile(proj,'mymodel.slx');

Input Arguments

expand all

proj — Projectproject object

Project, specified as a project object. Use simulinkproject to create a project object to manipulate a Simulink® Project at the command line.

file — Path of filestring

Path of the file to add relative to the project root folder, including the file extension, specified as a string. The file must be within the root folder.

Example: ‘models/myModelName.slx'

See Also

Functions

Was this topic helpful?