matlab.project.extractProject - Extract project from archive - MATLAB (original) (raw)

Main Content

Extract project from archive

Since R2022b

Syntax

Description

[proj](#mw%5F7f604417-4afc-4f89-ad84-021d2fea84d7) = matlab.project.extractProject([archive](#mw%5F21b73495-8205-46f8-9c9c-13d3afe9963d%5Fsep%5Fmw%5F09339ef1-8f7d-4372-9b8f-167ebe814ae3)) extracts the specified project archive to a new folder in the default project folder.matlab.project.extractProject opens the extracted project and returns the project object. Use the project object to manipulate the new project programmatically.

matlab.project.extractProject preserves the project files, structure, labels, shortcuts, and references. The extracted project does not include source control information.

example

[proj](#mw%5F7f604417-4afc-4f89-ad84-021d2fea84d7) = matlab.project.extractProject([archive](#mw%5F21b73495-8205-46f8-9c9c-13d3afe9963d%5Fsep%5Fmw%5F09339ef1-8f7d-4372-9b8f-167ebe814ae3),[destination](#mw%5Ffefa13f3-c1f7-47a2-be83-b0c5a54a4001)) extracts the specified project archive to the destination folderdestination.

example

Examples

collapse all

Open the Times Table App project. Create a project object from the currently loaded project by using the currentProject function.

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

Export the project to an archived project file.

export(initialproj,"myarchive.mlproj")

Extract the project archive in the default project folder.

proj = matlab.project.extractProject("myarchive.mlproj");

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

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

Export the project to an archived project file.

export(initialproj,"myarchive.zip")

Extract the project archive in the specified destination folder.

proj = matlab.project.extractProject("myarchive.zip","....\myProjectCopy");

Input Arguments

collapse all

Archive file name or path, specified as a character vector or string scalar that ends in the file extension .mlproj or .zip. If you do not specify the extension, the function appends the .mlproj extension to the file name and attempts an extraction.

Example: "project.mlproj"

Example: "project.zip"

Extracted project destination folder name or path, specified as a character vector or string scalar. If the destination folder exists, it must be empty. Otherwise, the function creates the destination folder before extracting the archive.

Example: "New Project"

Example: "..\..\New Project"

Output Arguments

collapse all

Project, returned as a matlab.project.Project object. Create a project object from the currently loaded project by using the currentProject function.

Version History

Introduced in R2022b