| Contents | Index |
thisCustomTarget.setCodeFlag(name,value)
The setCodeFlag method sets the value of a code flag whose name you specify.
thisCustomTarget | The custom Target object for which to set the code flag. |
name | Short string name of the 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 specific flag.
None
Assume that the Target object x represents the custom target for the loaded model. If m is the Stateflow machine object for this model, you can obtain x with the following command:
x = m.find('-isa','Stateflow.Target','Name','ctarg')
A custom target has thirteen code flags. You can verify this by looking at the CodeFlagsInfo property of x with this command:
x.CodeFlagsInfo.name
You enable or disable the comments code flag using the User Comments in generated code check box in the properties dialog box for this target. By default, this flag is turned on (== 1) for the custom target. You can verify this setting with the following command:
x.getCodeFlag('comments')
If you want to disable user comments, enter this command:
x.setCodeFlag('comments',0)

Learn how engineers use Stateflow to model state machines in their Simulink models.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |