| Contents | Index |
thisCustomTarget.getCodeFlag(name)
The getCodeFlag method returns the value of a code flag whose name you specify.
thisCustomTarget | The custom Target object for which to get the code flag value. |
The short string name of the code flag for which to get the value. See CodeFlagsInfo Property of Targets for a list of these names. |
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 this 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')
Similarly, you can get the values of the statebitsets and databitsets code flags, which you enable or disable using check boxes in the same dialog box. You can verify the settings with these commands:
x.getCodeFlag('statebitsets')
x.getCodeFlag('databitsets')

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 |