Main Content

Simulink.Simulation.Variable

Variables in Simulink.SimulationInput objects

Description

The Simulink.Simulation.Variables 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, there is no 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, WorksapceName and its value. Workspace can either be a model's name to indicate that the variable is in a model workspace or 'global-workspace' to indicate that it 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.

Name of the workspace that the variable is defined in, specified as a character vector.

Introduced in R2020a