getVariable
Return value of variable in the model workspace of a model
Description
returns the value of the variable whose name is varValue
= getVariable(mdlWks
,varName
)varName
that
exists in the model workspace represented by the
Simulink.ModelWorkspace
object
mdlWks
.
If the value of the target variable is a handle to a handle object (such as
Simulink.Parameter
),
getVariable
returns a copy of the handle. Changes you make
to the variable in the model workspace or to the returned variable
(variableValue
) affect both variables.
To return a deep copy of the handle object, use the copy
method of the object. To modify a handle object that you store in a model workspace,
it is a best practice to use both the getVariable
and
assignin
methods (see Modify Property Value of Handle Object).
Examples
Input Arguments
Output Arguments
Version History
Introduced in R2012a