Main Content

getInputParameterByName

Return value of input parameter for check

Since R2025a

    Description

    specificInput = getInputParameterByName(cfgObj,checkInstanceID,nameOfInputParameter) returns the value of the input parameter specified by nameOfInputParameter for a check checkInstanceID in the Model Advisor configuration accessed by the cfgObj object .

    example

    Examples

    collapse all

    Obtain the value of a specific input parameter of a check in a Model Advisor configuration.

    Create a Model Advisor configuration object.

    cfgObj = Advisor.Config;

    Load the myCustomFile.json file. Loading this file allows you to set the JSON file as an active configuration, providing you with access to edit it.

    loadConfig(cfgObj,"myCustomFile.json");

    Get the value of input parameter Follow links of the check mathworks.maab.db_0140 in the folder _SYSTEM_By Product_Simulink Check_Modeling Standards_JMAAB v5.1 Checks. You can obtain the check instance ID and the input parameter names in the Model Advisor when you select the check mathworks.maab.db_0140.

    specificInput = getInputParameterByName(cfgObj,"_SYSTEM_By Product_Simulink Check_Modeling Standards_JMAAB  v5.1 Checks_mathworks.maab.db_0140","Follow links")
    

    The getInputParameterByName function returns the current value of the input parameter Follow links of the check mathworks.maab.db_0140 in a structure.

    specificInput = 
    
      struct with fields:
    
            name: 'Look under masks'
           value: 'graphical'
         visible: 0
        isenable: 1
         entries: [1×1 mf.zero.PrimitiveSequence]

    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 from which you want to get the input parameters. You can obtain the check instance ID in the Model Advisor when you select the desired check.

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

    Name of the input parameter of a specific check, specified as a character vector or string scalar.

    Example: 'Block type and parameters to check against defaults'

    Output Arguments

    collapse all

    List of current values of the specified input parameter of a specified check, returned as a structure.

    Version History

    Introduced in R2025a