setVariable

Class: sltest.testmanager.TestIteration
Package: sltest.testmanager

Set model variable override

Syntax

setVariable(obj,'Name',varName,'Source',srcName,'Value',value)

Description

setVariable(obj,'Name',varName,'Source',srcName,'Value',value) sets a model variable override for the test iteration. Specify the sltest.testmanager.TestIteration object, and then specify the variable name, source, and override value. The method overrides the variable in the test iteration and does not permanently change the model variable.

Input Arguments

expand all

The test iteration you want to apply the override to, specified as a sltest.testmanager.TestIteration object.

Name of the variable you want to override, specified as a character vector.

The source of the variable to override, specified as a character vector. For non-real-time test cases, the possible sources can be 'base workspace', 'model workspace', 'mask workspace', or the name of a data dictionary, such as 'data.sldd' or model workspace name.

For real-time test cases, the possible sources are model element paths, which, if the source is a model parameter, might be an empty character vector.

Value of the variable to override.

Examples

expand all

setVariable(obj,'Name','g','Source','base workspace','Value',33);
Introduced in R2016a