主要内容

getSeverity

R2026b

Get check severity level

Since R2026b

    Description

    severity = getSeverity(cfgObj,ID) returns the severity level of the check specified by ID in the Model Advisor configuration object cfgObj.

    Examples

    collapse all

    Create a Model Advisor configuration object.

    cfgObj = Advisor.Config;

    Load the Model Advisor configuration file myCustomFile.json. Loading the file sets it as the active configuration so that you can access and edit it.

    loadConfig(cfgObj,"myCustomFile.json");

    Get the severity of the check mathworks.jmaab_v6.db_0032 in the folder _SYSTEM_By Product_Simulink Check_Modeling Standards_JMAAB v6 Checks. You can obtain the check instance ID and the input parameters in the Model Advisor when you select the check mathworks.jmaab_v6.db_0032. To obtain the instance ID, right-click the check and click Copy.

    severity = getSeverity(cfgObj,"_SYSTEM_By Product_Simulink Check_Modeling Standards_JMAAB v6 Checks_mathworks.jmaab_v6.db_0032")
    
    severity = 
     'Advisory'
     

    Input Arguments

    collapse all

    Model Advisor configuration object, specified as an Advisor.Config object.

    Instance ID of the check in Model Advisor, specified as a character vector or string scalar.

    The instance ID of the check represents the location of the check in the configuration file. To obtain the instance ID, right-click the check and click Copy.

    Example: "_SYSTEM_By Product_Simulink Check_Modeling Standards_JMAAB v5.1 Checks_mathworks.maab.db_0140"

    Output Arguments

    collapse all

    Severity level of the specified check, returned as one of these values:

    • 'Required' — A violation of this check is reported as a failure.

    • 'Advisory' — A violation of this check is reported as a warning.

    Version History

    Introduced in R2026b