Skip to Main Content Skip to Search
Product Documentation

modelinput - Create modelinput object

Syntax

Inputs = mbcmodel.modelinput('Property1',value1,'Property2',value2,...);
Inputs = mbcmodel.modelinput(NUMINPUTS);
Inputs = mbcmodel.modelinput(INPUTCELLARRAY);

Description

This is the constructor for the mbcmodel.modelinput object.

Inputs = mbcmodel.modelinput('Property1',value1,'Property2',value2,...);

You can set the properties shown in the following table.

PropertyDescription
Range[min,max]
NonlinearTransform{'','1./x','sqrt(x)',
'log10(x)','x.^2',

'log(x)'}
NameString. Signal name from data set. Inputs for a test plan must be set before selecting data.
SymbolString. Short name for plot labels and for use in CAGE.
UnitsString. Units are overwritten from the data set units when a data is selected.

Specify "property, value" pairs as follows:

Inputs = mbcmodel.modelinput('Symbol',{'A','B'},...
 'Range',{[0 100],[-20 20]});

Scalar expansion of properties is supported, e.g.,

Inputs = mbcmodel.modelinput('Symbol',{'A','B'},...
 'Range',[0 100]);

Inputs = mbcmodel.modelinput(NUMINPUTS);

NUMINPUTS is the number of inputs. Symbols are automatically set to 'X1', 'X2',...,'Xn'. The default range is [-1,1]. For example:

Inputs = mbcmodel.modelinput(2);

Inputs = mbcmodel.modelinput(INPUTCELLARRAY);

INPUTCELLARRAY is a cell array with one row per input and 5 columns to specify factor names, symbols, ranges and nonlinear transforms as follows.

The columns of INPUTCELLARRAY must be:

  1. Factor symbol (string)

  2. Minimum (double)

  3. Maximum (double)

  4. Transform (string) — empty for none

  5. Signal name

These columns are the same as the columns in the Model Factor Setup dialog box, which can be launched from the test plan in the model browser.

Examples

To create a modelinput object with 2 inputs, enter:

Inputs = mbcmodel.modelinput(2);

To create a modelinput object and define symbols and ranges, enter:

Inputs = mbcmodel.modelinput('Symbol',{'A','B'},...
 'Range',{[0 100],[-20 20]});
Inputs = mbcmodel.modelinput('Symbol',{'A','B'},...
 'Range',[0 100]);

To create a modelinput object and define inputs with a cell array, enter:

Inputs = mbcmodel.modelinput( {...
 'N',   800, 5000, '', 'ENGSPEED'
 'L',   0.1,    1, '', 'LOAD'
'EXH',  -5,   50, '', 'EXHCAM'
'INT',  -5,   50, '', 'INTCAM'} );

See Also

CreateModel | CreateTestplan

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS