Skip to Main Content Skip to Search
Product Documentation

getCodeFlag - Return specified code flag for custom target

Syntax

thisCustomTarget.getCodeFlag(name)

Description

The getCodeFlag method returns the value of a code flag whose name you specify.

Arguments

thisCustomTarget

The custom Target object for which to get the code flag value.

name

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.

Returns

None

Examples

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')

See Also

setCodeFlag

  


Free Stateflow Interactive Kit

Learn how engineers use Stateflow to model state machines in their Simulink models.


Get free kit

Trials Available

Try the latest version of Stateflow.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS