| Simulink® Verification and Validation™ | ![]() |
| On this page… |
|---|
Properties of Input Parameters |
Input parameters allow you to request input from the user for a Model Advisor check. You define input parameters using the ModelAdvisor.InputParameter class inside a custom check function (see Defining Custom Checks). You must define one instance of this class for each input parameter that you want to add to a Model Advisor check.
The following table describes the properties of the ModelAdvisor.InputParameter class:
| Property | Data Type | Default Value | Description |
|---|---|---|---|
| Name | String | '' (null string) | Name of the input parameter as it should appear in the custom check. |
| Type | Enumeration | '' (null string) | Type of input parameter. Used with Value or Entries to define input parameters. See the following table for details. |
| Value | Depends on Type. See following table. | Depends on Type. See following table. | Value of the input parameter. This property is valid only when the Type is Bool, String, Enum, or ComboBox. See following table. |
| Entries | Depends on Type. See following table. | Depends on Type. See following table. | This property is valid only when the Type is Enum, ComboBox, or PushButton. See following table. |
| Description | String | '' (null string) | Description of the parameter, which the Model Advisor displays in the right pane when you view details about the check. |
Types of Input Parameters
| Type | Data Type | Default Value | Description |
|---|---|---|---|
| Bool | Boolean | false | A check box. |
| String | String | '' (null string) | A text box. |
| Enum | Cell array | First entry in the menu | A drop-down menu.
|
| ComboBox | Cell array | First entry in the menu | A drop-down menu that allows the user to type in a value or
choose a value from the menu.
|
| PushButton | N/A | N/A | A button. When you click the button, the callback function specified by Entries is called. |
You can specify the layout of input parameters in the right pane of the Model Advisor window in an input parameter definition. Use the following methods to place input parameters.
ModelAdvisor.Check.setInputParametersLayoutGrid
Specifies the size of the input parameter grid.
ModelAdvisor.InputParameter.setRowSpan
Specifies the number of rows the parameter occupies in the Input Parameter layout grid.
ModelAdvisor.InputParameter.setColSpan
Specifies the number of columns the parameter occupies in the Input Parameter layout grid.
See the ModelAdvisor.Check and ModelAdvisor.InputParameter class references for information on using these methods.
The following is an example of defining input parameters to add to a custom check. You must include input parameter definitions inside a custom check definition (see Code Example: Check Definition Function). The following code, when included in a custom check definition, creates three input parameters.
rec = ModelAdvisor.Check('com.mathworks.sample.Check1');
rec.setInputParametersLayoutGrid([3 2]);
% define input parameters
inputParam1 = ModelAdvisor.InputParameter;
inputParam1.Name = 'Skip font checks.';
inputParam1.Type = 'Bool';
inputParam1.Value = false;
inputParam1.Description = 'sample tooltip';
inputParam1.setRowSpan([1 1]);
inputParam1.setColSpan([1 1]);
inputParam2 = ModelAdvisor.InputParameter;
inputParam2.Name = 'Standard font size';
inputParam2.Value='12';
inputParam2.Type='String';
inputParam2.Description='sample tooltip';
inputParam2.setRowSpan([2 2]);
inputParam2.setColSpan([1 1]);
inputParam3 = ModelAdvisor.InputParameter;
inputParam3.Name='Valid font';
inputParam3.Type='Combobox';
inputParam3.Description='sample tooltip';
inputParam3.Entries={'Arial', 'Arial Black'};
inputParam3.setRowSpan([2 2]);
inputParam3.setColSpan([2 2]);
rec.setInputParameters({inputParam1,inputParam2,inputParam3});The Model Advisor displays these input parameters in an Input Parameters box in the right pane.

![]() | Defining Custom Checks | Defining Check List Views | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |