export

(Not recommended) Export project to zip

simulinkprojectis not recommended. UsecurrentProjectoropenProjectinstead. For more information, seeCompatibility Considerations.

Description

example

export(proj,zipFileName)exports the projectprojto a zip file specified byzipFileName. The zip archive preserves the project files, structure, labels, and shortcuts, and does not include any source control information. You can use the zip archive to send the project to customers, suppliers, or colleagues who do not have access to your source control repository. Recipients can create a new project from the zip archive by clickingNewin the Project Tool, and then in the start page, clicking存档.

export(proj,zipFileName,definitionType)exports the project using the specifieddefinitionTypefor the project definition files, single or multiple. If you do not specifydefinitionType, the project's current setting is used. Use thedefinitionTypeexport option if you want to change project definition file management from the type selected when the project was created. You can control project definition file management in the preferences.

Examples

collapse all

Open the airframe project and create a project object.

sldemo_slproject_airframe; proj = simulinkproject;

Export the project to a zip file.

export(proj,'airframeproj.zip')

Input Arguments

collapse all

Project, specified as a project object. Usesimulinkprojectto create a project object to manipulate a project at the command line.

Zip file name or path, specified as a character vector ending in the file extension.zip. IfzipFileNameis a filename, Simulink®exports the file to the current folder. You can also specify a fully qualified path name.

Example:'project.zip'

Data Types:char

Definition file type, specified asslproject.DefinitionFiles.SingleFile,slproject.DefinitionFiles.MultiFile, orslproject.DefinitionFiles.FixedPathMultiFile. Use thedefinitionTypeexport option if you want to change project definition file management from the type selected when the project was created.MultiFileis better for avoiding merging issues on shared projects.SingleFileis faster but is likely to cause merge issues when two users submit changes in the same project to a source control tool. If you need to work with long file paths, useFixedPathMultiFile.

Example:export(proj,'proj.zip',slproject.DefinitionFiles.SingleFile)

Compatibility Considerations

expand all

Not recommended starting in R2019a

See Also

Introduced in R2013a