Main Content

Simulink.Simulation.Variable Class

Namespace: Simulink.Simulation

Variables in Simulink.SimulationInput objects

Since R2020a

Description

The Simulink.Simulation.Variable object specifies the variable and its value used by the Simulink.SimulationInput object during simulation. By default, this object overrides variables that already exist in the base workspace or the data dictionary.

In most cases, you do not need to create an object of this class directly. To add a variable to the Simulink.SimulationInput object, use the setVariable method on the Simulink.SimulationInput object.

Creation

var = Simulink.Simulation.Variable(variableName,Value) creates a Simulink.Simulation.Variables object, var, that specifies the variable and its value.

var = Simulink.Simulation.Variable(variableName,Value,'Workspace',WorkspaceName) creates a Simulink.Simulation.Variables object, var, that specifies the variable defined in the specified workspace, WorkspaceName and its value. The workspace can either be the name of a model to indicate that the variable is in a model workspace or 'global-workspace' to indicate that the variable is either in the base workspace or in a data dictionary.

Properties

expand all

Name of the variable, specified as a character vector.

Value of the variable, specified as a character vector.

Workspace of the variable, specified as a character vector.

Context of variables within global workspace, specified as a character vector.

Description of the variable, specified as a character vector.

Version History

Introduced in R2020a