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.

addFolderIncludingChildFiles

(Not recommended) Add folder and child files to project

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

Syntax

addFolderIncludingChildFiles(proj,folder)

Description

example

addFolderIncludingChildFiles(proj,folder) adds a folder and all child files to the project proj.

Examples

collapse all

Open the airframe project and create a project object.

sldemo_slproject_airframe
proj = simulinkproject;

Create a new folder in the project folder.

new_folder_path = fullfile(proj.RootFolder, 'new_folder')
mkdir(new_folder_path);

Create a new folder in the previous folder.

new_sub_folder_path = fullfile(new_folder_path, 'new_sub_folder')
mkdir(new_sub_folder_path);

Create a new file in the folder.

filepath = fullfile(new_sub_folder_path, 'new_model_in_subfolder.slx')
new_system('new_model_in_subfolder');
save_system('new_model_in_subfolder', filepath)

Add this new folder and child files to the project.

projectFile = addFolderIncludingChildFiles(proj, new_folder_path)

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 folder to add relative to the project root folder, specified as a character vector or string. The folder must be within the root folder.

Example: ‘models’

Compatibility Considerations

expand all

Not recommended starting in R2019a

See Also

Functions

Introduced in R2015b