Main Content

matlab.project.extractProject

Extract project from archive

Since R2022b

    Description

    proj = matlab.project.extractProject(archive) 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 = matlab.project.extractProject(archive,destination) extracts the specified project archive to the destination folder destination.

    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