Stateflow    
Target Properties

Stateflow API objects of type Target have the properties listed in the table below. See also Target Methods.

Property
Type
Acc
Description
ApplyToAllLibs
Boolean
RW
If set to true (default), use settings in this target for all libraries. Equivalent to selecting the Use settings for all libraries check box in this target's Target Builder dialog.
CodeFlagsInfo
Array
RO
A MATLAB vector of structures containing information on the code flag settings for this target. See special topic CodeFlagsInfo Property of Targets for more information.
CodegenDirectory
String
RW
Directory to receive generated code (default = ''). Applies only to targets other than sfun and rtw targets.
CustomCode
String
RW
Custom code included at the top of the generated code (default = ''). Equivalent to the setting of the Custom code included at the top of generated code selection of the Target Options dialog for this target.
CustomInitializer
String
RW
Custom initialization code (default = ''). Equivalent to the setting of the Custom initialization code (called from mdlInitialize) selection of the Target Options dialog for this target. Applies only to sfun and rtw targets.
CustomTerminator
String
RW
Custom termination code (default = ''). Equivalent to the setting of the Custom termination code (called from mdlTerminate) selection of the Target Options dialog for this target. Applies only to sfun and rtw targets.
Description
String
RW
Description of this target (default = ''). Equivalent to entering a description in the Description field of the properties dialog for this target.
Document
String
RW
Document link to this target (default = ''). Equivalent to entering the Document Link field of the properties dialog for this target.
Id
Integer
RO
Unique identifier assigned to this Target object to distinguish it from other objects loaded in memory.
Machine
Machine
RO
Stateflow machine containing this target.
Name
String
RW
Name of this target (default = 'untitled'). Equivalent to naming or renaming this target in the Explorer.
Tag
Any Type
RW
Holds data of any type (default = []) for this target.
UserIncludeDirs
String
RW
Custom include directory paths (default = ''). Equivalent to the setting of the Custom include directory paths selection of the Target Options dialog for this target.
UserLibraries
String
RW
Custom libraries (default = ''). Equivalent to the setting of the Custom libraries selection of the Target Options dialog for this target.
UserSources
String
RW
Custom source files (default = ''). Equivalent to the setting of the Custom source files selection of the Target Options dialog for this target.

CodeFlagsInfo Property of Targets

The CodeFlagsInfo property of a Target object is a read-only MATLAB vector of structures containing information on the code flag settings for its target. Each element in the vector has the following MATLAB structure of information about a particular code flag:

Element
Type
Description
name
String
Short name for this flag
type
String
The type of the code flag
description
String
A description of this code flag
defaultValue
Boolean
The default value of this code flag upon creation of its target
visible
Boolean
Whether or not this flag is visible
enable
Boolean
Whether or not to enable this flag
value
Boolean
The value of the flag

The first element of each structure is a shorthand name for the individual flag that you set in the Coder Options dialog. For example, the name 'comments' actually refers to the dialog setting Comments in generated code. While the CodeFlagsInfo property is informational only, you can use these shorthand flag names in the methods getCodeFlag and setCodeFlag to access and change the values of a flag.

The names of each of the possible code flags in the CodeFlagsInfo property along with the name of the flag as it appears in the Coder Options dialog for the target are as follows:

Name in CodeFlagsInfo
Name in Properties Dialog
Target
Default Value
debug
Enable debugging/animation
sfun
Enabled
overflow
Enable overflow detection (with debugging)
sfun
Enabled
echo
Echo expressions without semicolons
sfun
Enabled
comments
Comments in generated code
rtw, custom
Disabled Enabled
preservenames
Preserve symbol names
rtw, custom
Disabled
preservenameswithparent
Append symbol names with no mangling
rtw, custom
Disabled
exportcharts
Use chart names with no mangling
rtw, custom
Disabled
statebitsets
Use bitsets for storing state configuration
rtw, custom
Disabled
databitsets
Use bitsets for storing boolean data
rtw, custom
Disabled
ioformat
Enumerated value can be one of the following:
  • 0 = Use global input/output data
  • 1 = Pack input/output data into structures
  • 2 = Separate argument for input/output data
custom
0
initializer
Generate chart initializer function
custom
Disabled
multi
instanced

Multi-instance capable code
custom
Disabled
ppcomments
Comments for Post-processing
custom
Disabled

For detailed descriptions of each of the preceding code flags, see Specifying Code Generation Options.


  Event Properties Methods by Object