Add folder and child files to万博1manbetxProject
addFolderIncludingChildFiles(proj,folder)
example
addFolderIncludingChildFiles(proj,folder)adds a folder and all child files to the projectproj.
proj
folder
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)
Project, specified as a project object. Usesimulinkprojectto create a project object to manipulate a Simulink®Project at the command line.
simulinkproject
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’
addFile
removeFile
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:.
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office
Get trial now