export

Export project to archive

Description

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 no extension is specified, MATLAB® appends the .mlproj extension to the file.

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.

export(proj,archiveName,'ArchiveReferences',archiveReferences) exports the specified project to a new project archive file and specifies whether to include the project references in the package.

Examples

collapse all

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

matlab.project.example.timesTable
proj = currentProject;

Export the project to an archived project file.

export(proj,"timestableproj.mlproj")

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

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 file name, MATLAB exports the file to the current folder. You also can specify a fully qualified path name.

Example: "project.mlproj"

Include references in the package, specified as true or false.

If 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 false, MATLAB exports the project and preserves the existing absolute and relative link to the references. For a working project on extraction, the references must be at the same absolute and relative paths.

The argument is ignored if the project does not have references.

Data Types: logical

Introduced in R2019a