Main Content


Change definition file type of project

Since R2020b



    matlab.project.convertDefinitionFiles(projectRoot,definitionType) converts the definition file type of the project stored in projectRoot to a new type specified by definitionType. matlab.project.convertDefinitionFiles preserves the source control history of your project.


    To avoid merge issues, do not convert the definition file type more than once for a project.


    collapse all

    Check which definition file management your project uses currently.

    projectRoot = "C:/projects/myproject";
    proj = openProject(projectRoot);
    currentDefinitionFileType = proj.DefinitionFilesType
    currentDefinitionFileType = 
      DefinitionFiles enumeration

    Close your project before converting the project definition file management.


    Programmatically convert the project definition file management to use fixed-path multiple project files.


    Check the new project definition file management.

    proj = openProject(projectRoot);
    newDefinitionFileType = proj.DefinitionFilesType
    newDefinitionFileType = 
      DefinitionFiles enumeration

    Input Arguments

    collapse all

    Full path to project root folder, specified as a character vector or string scalar.

    Example: "C:/projects/myproject"

    Data Types: char | string

    Definition file type, specified as matlab.project.DefinitionFiles.SingleFile, matlab.project.DefinitionFiles.MultiFile, or matlab.project.DefinitionFiles.FixedPathMultiFile.

    Choose a definition file type based on your use case:

    • MultiFile - Helps to avoid file conflicts when performing merge on shared projects

    • SingleFile - Is faster but is likely to cause merge issues when two users submit changes in the same project to a source control tool

    • FixedPathMultiFile - Is better if you need to work with long paths

    Version History

    Introduced in R2020b