主要内容

setInputParametersLayoutGrid

为输入参数指定布局网格

语法

setInputParametersLayoutGrid(check_obj, [row col])

说明

setInputParametersLayoutGrid(check_obj, [row col]) 指定模型顾问中输入参数的布局网格。当有多个输入参数时,使用 setInputParametersLayoutGrid 方法。

输入参数

check_objModelAdvisor.Check 类的实例化
row布局网格中的行数
col布局网格中的列数

示例

以下示例是检查定义函数中的一段代码。如果没有完整的检查定义函数,该示例不会按所示方式执行。

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