Main Content

export

Export project to archive

Since R2019a

Description

example

export(proj,archiveName) exports the specified project to a new project archive file named archiveName. archiveName must include the .mlproj extension or no extension at all. If archiveName does not include the .mlproj extension, MATLAB® appends it to the filename.

The project archive preserves the project files, structure, labels, and shortcuts, and does not include any source control information. You can use the project archive to send the project to customers, suppliers, or coworkers who do not have access to your source control repository. Recipients can create a new project from the archive by double-clicking the project archive file.

By default, this function packages all the project references in the archive. You might not want this option if the project contains references to absolute networks paths. In this case, the function duplicates the project itself and treats it as a relative reference upon extraction.

example

export(proj,Name,Value) exports the specified project to a new project archive file with additional options specified by one or more name-value arguments.

Examples

collapse all

Open the Times Table App project. Use currentProject to create a project object from the currently loaded project.

openExample("matlab/TimesTableProjectExample")
proj = currentProject;

Export the project to an archived project file.

export(proj,"timestableproj.mlproj")

You can now send the project by sharing the file timestableproj.mlproj.

Open the project you want to export. Use currentProject to create a project object from the currently loaded project.

openProject("myProject.prj");
proj = currentProject;

Export a subset of project files with a user-defined export profile named excludetests. See Create an Export Profile.

export(proj,"myProjectArchive.mlproj",ExportProfile="excludetests")

Input Arguments

collapse all

Project, specified as a matlab.project.Project object. Use currentProject to create a project object from the currently loaded project.

Archive file name or path, specified as a character vector or string scalar ending in the file extension .mlproj. If no extension is specified, MATLAB appends the .mlproj extension to the file name.

If archiveName is a filename, MATLAB exports the file to the current folder. You also can specify a fully qualified path name.

Example: "projectArchive.mlproj"

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: export(proj,"archivewithnoReferences.mlproj",ArchiveReferences=false)

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: export(proj,"archivewithnoReferences.mlproj","ArchiveReferences",false)

Option to include references in the package, specified as true or false.

If you specify true, MATLAB exports the project and includes the references in the package. Extracting the archive creates a copy of the referenced projects and links them to the top-level project. It also includes a copy of projects referenced by your referenced projects.

If you specify false, MATLAB exports the project and preserves the existing absolute and relative link to the references. To ensure the top-level project does not have missing references when you extract the archive, references must exist at the same absolute and relative paths.

If the project has no references, the option does not apply.

Data Types: logical

Option to specify the export profile name, specified as a character vector or string scalar.

If specified, MATLAB exports a subset of the project files specified by ExportProfile. Export profiles do not apply changes to referenced projects. When you share your project, MATLAB exports the entire referenced projects.

Data Types: char | str

Version History

Introduced in R2019a

expand all