Stateflow | ![]() ![]() |
Set the specified code flag to the value you specify
Syntax
Description
The setCodeFlag
method sets the value of a code flag whose name you specify.
Arguments
thisTarget |
Target object for which to set code flag. |
name |
String name of code flag. See CodeFlagsInfo Property of Targets for a list of these names. |
value |
Value of code flag. Can be of any type. |
Flag values can vary in type. Use the property CodeFlagsInfo
to obtain the type for a particular flag.
Returns
Example
Assume that the Target object x
represents the simulation target sfun
for the loaded model. If m
is the Stateflow machine object for this model, you can obtain x
with the following command:
The simulation target has two code flags: debug
and echo.
You can verify this by looking at the CodeFlagsInfo
property of x
with the following command:
In the Stateflow user interface the debug
code flag is enabled or disabled through the Enable debugging/animation check box in the Coder Options dialog. By default, this flag is turned on (==1) for the simulation target, which you can verify with the following command:
If you want to disable debugging, enter the following command:
See Also
The method getCodeFlag
![]() | set | sfclipboard | ![]() |