Evaluate expression in the model workspace of a model
evaluates the expression result
= evalin(mdlWks
,expression
)expression
in the model workspace
represented by the Simulink.ModelWorkspace
object represented by
mdlWks
. The function returns the result of the expression in
result
.
Note
For setting and getting variable properties in the model workspace,
consider using setVariablePart
and
getVariablePart
instead of
evalin
because:
The functions do not create new variables or cause unintended results.
getVariablePart
does not dirty the
model.
For information on these alternatives, see Simulink.ModelWorkspace
.