主要内容

experimentNames

R2026b

List experiment names in project

Since R2026b

    Description

    expNames = experimentNames(projectFolder) returns the names of all experiments in the specified MATLAB® project.

    example

    Examples

    collapse all

    List all experiments in a MATLAB project.

    expNames = experimentNames("MyProject")
    expNames =
    
      3x1 string array
    
        "Experiment1"
        "Experiment2"
        "Experiment3"

    You can index into expNames to pass an experiment name to other functions. For example, you can use runExperiment("MyProject",expNames(1)).

    Input Arguments

    collapse all

    Project PRJ file or project root folder, specified as a string scalar or character vector. You can specify an absolute or relative path. The project must contain one or more Experiment Manager experiments.

    Example: "C:\Projects\MyProject\MyProject.prj"

    Example: "C:\Projects\MyProject"

    Example: "MyProject"

    Output Arguments

    collapse all

    Experiment names, returned as a string array containing the names of all experiments in the specified project.

    Version History

    Introduced in R2026b