Main Content

ModelAdvisor.InputParameter Class

Namespace: ModelAdvisor
Superclasses:

Add input parameters to custom checks

Description

Instances of the ModelAdvisor.InputParameter class specify the input parameters a custom check uses in analyzing the model. Access input parameters in the Model Advisor window.

Creation

Description

input_param = ModelAdvisor.InputParameter creates a handle to an input parameter object, input_param.

Note

You must include input parameter definitions in a check definition.

Methods

setColSpanSpecify number of columns for input parameter
setRowSpanSpecify rows for input parameter

Properties

DescriptionDescription of input parameter
EntriesDrop-down list entries
NameInput parameter name
TypeInput parameter type
ValueValue of input parameter

Copy Semantics

Handle. To learn how this affects your use of the class, see Copying Objects in the MATLAB® Programming Fundamentals documentation.

Examples

collapse all

You can request input before running a custom check by using input parameters.

Define input parameters by using the ModelAdvisor.InputParameter class.

You can specify the layout of input parameters in Model Advisor by using the methods setInputParametersLayoutGrid, setRowSpan, and setColSpan.

You must include input parameter definitions inside a custom check definition function. You must define one instance of this class for each input parameter that you want to add to a custom check. The following example is a fragment of code from a check definition function. The example does not execute as shown without the full check definition function.

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});