setInputParameterByName
R2026bDescription
setInputParameterByName(
updates the value defined by cfgObj,checkInstanceID,nameOfInputParameter,valueOfInputParameter)valueOfInputParameter of the input
parameter specified by nameOfInputParameter for the check
checkInstanceID in the Model Advisor configuration accessed by the
cfgObj object.
Examples
Update the value of a specific input parameter of a check in a Model Advisor configuration.
Create a Model Advisor configuration object.
cfgObj = Advisor.Config;
Save the default Model Advisor configuration to a JSON file.
saveConfiguration(cfgObj,"myCustomFile.json");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");Set the value of the Follow links input parameter of the check
mathworks.maab.db_0140 in the folder _SYSTEM_By
Product_Simulink Check_Modeling Standards_JMAAB v5.1 Checks to
off. You can obtain the check instance ID and the input parameters
in the Model Advisor when you select the check
mathworks.maab.db_0140. To obtain the instance ID, right-click the
check and click Copy.
setInputParameterByName(cfgObj,"_SYSTEM_By Product_Simulink Check_Modeling Standards_JMAAB v5.1 Checks_mathworks.maab.db_0140","Follow links","off");
Verify the updated value by using
getInputParameterByName.
result = getInputParameterByName(cfgObj,"_SYSTEM_By Product_Simulink Check_Modeling Standards_JMAAB v5.1 Checks_mathworks.maab.db_0140","Follow links"); result.value
ans =
'off'Update the value of a BlockType
input parameter by passing a struct directly.
Create a Model Advisor configuration object.
cfgObj = Advisor.Config;
Save the default Model Advisor configuration to a JSON file.
saveConfiguration(cfgObj,"myCustomFile.json");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");Create a configuration that contains only the check
mathworks.jmaab.jc_0008.
createFromCheckList(cfgObj, {'mathworks.jmaab.jc_0008'});Refresh the Model Advisor customizations to apply the updated configuration.
Advisor.Manager.refresh_customizations
Specify the check instance ID and input parameter name. Create a struct that specifies the block types to check for output signal labels.
instanceId = '_SYSTEM_mathworks.jmaab.jc_0008'; paramName = 'List of block types to check output signal labels'; newValue = struct('name', {'Inport', 'Gain'}, 'masktype', {'', ''});
Update the List of block types to check output signal labels
input parameter of the check.
setInputParameterByName(cfgObj, instanceId, paramName, newValue);
Verify the updated value by using
getInputParameterByName.
getInputParameterByName(cfgObj,instanceId,paramName)
ans =
struct with fields:
name: 'List of block types to check output signal labels'
type: 'BlockType'
value: [2×1 struct]Input Arguments
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.
Example: "_SYSTEM_By Product_Simulink Check_Modeling Standards_JMAAB v5.1
Checks_mathworks.maab.db_0140"
Name of the input parameter whose value is overwritten, specified as a character vector or string scalar.
Example: "Follow links"
The value of an input parameter that overwrites the existing value, specified as a
character vector, string scalar, or struct. For BlockType and
BlockTypeWithParameter parameters, specify the value as a
struct.
Example: "on"
Version History
Introduced in R2025a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)