Main Content

addFolder

Add member folder to package

Since R2024b

    Description

    addFolder(pkg,folders) adds the specified folders as member folders to the package and updates the Folders property of the package object. The package pkg must be in editable mode.

    example

    Examples

    collapse all

    Create a package named MyPackage.

    pkg = mpmcreate("MyPackage","MyPackage");

    Add a new member folder to MyPackage.

    mkdir("MyPackage/Classes")
    pkg.Folders
    ans = 
    
      1×0 PackageFolder array with properties:
    
        Path

    Update the package to include the new member folder by using addFolder.

    addFolder(pkg,"Classes")
    pkg.Folders
    ans = 
    
      PackageFolder with properties:
    
        Path: "Classes"

    Input Arguments

    collapse all

    Package, specified as a matlab.mpm.Package object.

    Member folders to add, specified as a string array where each element is the path to a folder, or a matlab.mpm.PackageFolder array. All elements of folders must represent folders that exist.

    Version History

    Introduced in R2024b