主要内容

AddVariable

Add variable to data set

Description

DataObjMod = AddVariable(DataObj,Expr,Units) adds a variable to the data set. Variable names are case sensitive.

example

Examples

collapse all

Add a variable, MY_NEW_VARIABLE, that depends on TQ and AFR.

DataObjMod = AddVariable(DataObj,'MY_NEW_VARIABLE = TQ*AFR/2');

Add a variable that uses the function MyVariableFunction. The function uses the variables TQ, AFR, and RPM.

DataObjMod = AddVariable(DataObj,'funcVar = MyVariableFunction(TQ, AFR, RPM)', 
'lb');

Add a variable if the signal names in data do not match the model input factors in the test plan template file.

DataObjMod = AddVariable(DataObj,'TQ=tq');

Input Arguments

collapse all

mbcmodel.data data object.

Input character vector containing the expression. To define the expression, use logical operators or a logical function on the existing variables.

Example: 'AFR < AFR_CALC + 10'

Data Types: char

Input character vector containing the expression that defines the variable units.

Example: 'lb'

Data Types: char

Output Arguments

collapse all

Modified mbcmodel.data object.

Version History

Introduced before R2006a