Contenuto principale

save

R2026b

Save configuration to file without registering

Since R2026b

    Description

    save(config) validates and saves the configuration object to the file specified by the FileName property of the configuration. Save the configuration to keep changes you have made to threshold sets, threshold rules, or classifications.

    example

    save(config,filename) validates and saves the configuration object to the specified filename.

    example

    Examples

    collapse all

    Copy a shipping threshold set, set the file path, and save the configuration.

    config = metric.config.Configuration.copyThresholdSet( ...
        SourceThresholdSetId="Testing", ...
        TargetThresholdSetId="MyTestingThresholds");
    proj = currentProject;
    p = proj.RootFolder;
    config.FileName = fullfile(p,"MyConfig.json");
    save(config);

    Save the configuration to a specific file path.

    config = metric.config.Configuration.copyThresholdSet( ...
        SourceThresholdSetId="ReqBasedTesting", ...
        TargetThresholdSetId="MyTestingThresholds");
    proj = currentProject;
    p = proj.RootFolder;
    save(config,fullfile(p,"configs","CustomThresholds.json"));

    Input Arguments

    collapse all

    Configuration, specified as a metric.config.Configuration object.

    Path to save the configuration file, specified as a string scalar. If you do not specify a value, the function defaults to the FileName property of the configuration object.

    Data Types: string

    More About

    collapse all

    Version History

    Introduced in R2026b