| Contents | Index |
| On this page… |
|---|
Reference Table Column Descriptions Code Generation and Target Building |
Reference tables for Stateflow API properties and methods have these columns:
Name — The name for the property or method. Each property or method has a name that you use in dot notation along with a Stateflow object to set or obtain the property's value or call the method.
Type — A data type for the property. Some types are other Stateflow API objects, such as the Machine property, which is the Machine object that contains this object.
Access — An access type for the property. Properties that are listed as RW (read/write) can be read and changed. For example, the Name and Description properties of particular objects are RW. However, some properties are RO (read-only) because they are set by the MATLAB workspace itself.
Description — A description for the property or method. For some properties, the equivalent GUI operations for setting it are also given.
Objects — The types of objects that have this property or method. The object types are listed as follows: Root (R), Machine (M), Chart (C), State (S), Atomic Subchart (AS), Box (B), Graphical Function (F), Truth Table (TT), MATLAB Function (EM), Simulink Function (SLF), Note (N), Transition (T), Junction (J), Event (E), Data (D), Target (X), Editor (ED), and Clipboard (CB).
The following methods find, get, and set objects and their properties.
Method | Description | Objects |
|---|---|---|
Return the default transitions in this chart at the top level of containment. | ||
Display the property names and their settings for this object. | ||
Find all objects that this object contains that meet the criteria specified by the arguments. | ||
Return the specified property settings for this object. | ||
Display a list of properties for this object with short descriptions. Used with all objects except the Root and Machine object. | ||
Return the inner transitions that originate with this object and terminate on a contained object. | ||
Return the methods of this object. | ||
Return an array of transitions that exit the outer edge of this object and terminate on an object outside the containment of this object. | ||
Set the specified property of this object with a specified value. Used with all objects except the Root object. | ||
Return all inner and outer transitions whose destination is this object. | ||
Return all inner and outer transitions whose source is this object. | ||
Return a MATLAB structure containing the property settings of this object. |
The following methods control parsing, code generation, and building of custom targets.
Method | Description | Objects |
|---|---|---|
Build this custom target only for those portions of the target's charts that have changed since the last build (i.e., incrementally). See also the methods rebuildAll, generate, rebuildAll, and make. | ||
Generate code for this custom target only for those portions of this target's charts that have changed since the last code generation (i.e., incrementally). See also the methods build, rebuildAll, regenerateAll, and make. | ||
Return the value of the specified code flag for this custom target. | ||
Compile this custom target incrementally, only for those portions of this target's charts that have changed since the last compilation. See also the methods build, rebuildAll, generate, and regenerateAll. | ||
Parses all the charts in this machine (model) or just this chart. | ||
Completely rebuild this custom target. See also the methods build, generate, regenerateAll, and make. | ||
Completely regenerate code for this custom target. See also the methods build, rebuildAll, generate, and make. | ||
Set the value of the specified code flag for this custom target. |
The following properties control the code generated from the Stateflow charts in a model.
Property | Type | Access | Description | Objects |
|---|---|---|---|---|
ApplyToAllLibs | Boolean | RW | If set to true, use settings in this custom target for all libraries. Equivalent to selecting the Use these custom code settings for all libraries check box in the Custom Target dialog box. | |
CodeFlagsInfo | Array | RO | A MATLAB vector of structures containing information on code flag settings for this custom target. Each element in the vector is a MATLAB structure with information about a specific code flag. Each flag corresponds to a selection in the properties dialog box for this target. If you want to see information about the first flag for a Target object x, use these commands: cfi = x.CodeFlagsInfo disp(cfi(1)) If you want to see the names of all the flags, use this command: cfi.name The Name member of the CodeFlagsInfo structure is shorthand for a longer expression in the properties dialog box. For example, the name 'comments' refers to the dialog box setting User Comments in generated code. You use the name of a code flag to get and set the code flag value with the methods getCodeFlag and setCodeFlag. Changing the vector returned by CodeFlagsInfo does not change an actual flag. | |
EnableBitOps | Boolean | RW | If set to true, enable C-like bit operations in generated code for this chart. Equivalent to selecting the Enable C-bit operations check box in the Chart properties dialog box. |
The following properties control the custom code that you include with a Stateflow chart.
Property | Type | Access | Description | Objects |
|---|---|---|---|---|
CodegenDirectory | String | RW | Folder to store generated code for a custom target (default = ''). Equivalent to the entry in the Generated Code Directory field of the custom code settings in the Custom Target dialog box. | |
CustomCode | String | RW | Custom code included at the top of the generated header file for a custom target (default = ''). Equivalent to the entry in the Include Code field of the custom code settings in the Custom Target dialog box. | |
UserIncludeDirs | String | RW | Space-separated list of custom include folder paths for a custom target (default = ''). Equivalent to the entry in the Include Paths field of the custom code settings in the Custom Target dialog box. | |
UserLibraries | String | RW | Space-separated list of custom libraries for a custom target (default = ''). Equivalent to the entry in the Libraries field of the custom code settings in the Custom Target dialog box. | |
UserSources | String | RW | Space-separated list of custom source files for a custom target (default = ''). Equivalent to the entry in the Source Files field of the custom code settings in the Custom Target dialog box. | |
ReservedNames | String | RW | Comma- or space-separated list of names to not use in Stateflow generated code for a custom target. Equivalent to the entry in the Reserved Names field of the custom code settings in the Custom Target dialog box. |
The following properties control how one Stateflow object contains another Stateflow object.
Property | Type | Access | Description | Objects |
|---|---|---|---|---|
Chart | Chart | RO | Chart object containing this object. | |
Decomposition | Enum | RW | Set this property to 'EXCLUSIVE_OR' to specify exclusive (OR) decomposition for the states at the first level of containment in this chart or state. Set to 'PARALLEL_AND' to specify parallel (AND) decomposition for these states. | |
IsGrouped | Boolean | RW | If set to true, group this object. Nothing is allowed to change inside a grouped object. You must first ungroup the object before you can change its contents. This property is also useful for copying states and their contents to a new location. See Copying by Grouping (Recommended). | |
IsSubchart | Boolean | RW | If set to true, makes this state, box, or graphical function a subchart. | |
Machine | Machine | RO | Machine that contains this object. A machine object contains all of the Chart objects in a Model. |
Use the following methods to create and delete Stateflow objects.
Method | Description | Objects |
|---|---|---|
Copy the specified array of objects to the clipboard for pasting. See also the pasteTo method. | CB | |
Delete this object. | All but R M C CB ED | |
Paste the objects in the Clipboard to the specified container object. See also copy method. | CB | |
Create an atomic subchart for a parent chart or state. | NA | |
Create a box for a parent chart, state, box, or function. | NA | |
Create a data for a parent machine, chart, state, box, or function. | NA | |
Create a MATLAB function for a parent chart or state. | NA | |
Create an event for a parent chart or state. | NA | |
Create a graphical function for a parent chart, state, box, or function. | NA | |
Create a junction for a parent chart, state, box, or function. | NA | |
Create a note for a parent chart or state. | NA | |
Create a Simulink function for a parent chart or state. | NA | |
Create a state for a parent chart, state, box, or function. | NA | |
Create a custom target for a parent machine. | NA | |
Create a transition for a parent chart, state, box, or function. | NA | |
Create a truth table function for a parent chart or state. | NA |
The following properties control the type, size, and value of data in Stateflow charts.
Property | Type | Access | Description | Objects |
|---|---|---|---|---|
DataType | Enum | RW | Data type of this data. Can have one of the following possible values: 'boolean', 'uint8', 'int8', 'uint16', 'int16', 'uint32', 'int32', 'single', 'double' and 'fixpt'. Equivalent to an entry in the Type column for this data in the Model Explorer or the Type field in the Data properties dialog box. | |
FixptType. | Double | RW | The Bias value for this fixed-point type. | |
FixptType. | Double | RW | The Fractional Slope value for this fixed-point type. | |
FixptType. | Integer | RW | The power of two specifying the binary point location for this fixed-point type. | |
FixptType. | Enum | RW | The size and sign of the base for the quantized integer, Q, of this fixed-point type. | |
ParsedInfo. | Integer | RO | Numeric equivalent of string Data property Props.Range.FirstIndex. | |
ParsedInfo. | Integer | RO | Numeric equivalent of string Data property Props.Array.Size. | |
ParsedInfo. | Double | RO | Numeric equivalent of string Data property Props.InitialValue. | |
ParsedInfo. | Double | RO | Numeric equivalent of string Data property Props.Range.Maximum. | |
ParsedInfo. | Double | RO | Numeric equivalent of string Data property Props.Range.Minimum. | |
Port | Integer | RW | Port index number for this input or output data or event (default = 1). | |
Props. | String | RW | Index of the first element of this data if it is an array (Props.Array.Size >= 1). Equivalent to entering a value of zero or greater in the First index field of the Data properties dialog box. | |
Props. | String | RW | Specifying a positive value for this property specifies that this data is an array of specified size. Equivalent to entering a positive value in the Size column for this data in the Model Explorer or in the Size field of the Data properties dialog box. | |
Props. | Enum | RW | If set to 'On', the data can take complex values. The default value is 'Off', which indicates that the data cannot take complex values. Equivalent to setting Complexity in the Data properties dialog box. | |
Props. | Enum | RW | If set to 'Frame based', the data supports frame-based signals. The default value is 'Sample based', which indicates that the data supports sample-based signals. | |
Props. | String | RW | If the source of the initial value for this data is the Stateflow hierarchy, this is the value used. Equivalent to entering this value in the InitVal column for this data in the Model Explorer or similar field in the Data properties dialog box. | |
Props. | String | RW | Maximum value that this data can have during execution or simulation of the state machine. Equivalent to entering value in Max column for this data in the Model Explorer or the Maximum field in the Data properties dialog box. | |
Props. | String | RW | Minimum value that this data can have during execution or simulation of the state machine. Equivalent to entering value in the Min column for this data in the Model Explorer or in the Minimum field in the Data properties dialog box. | |
Props. | Integer | RW | If set to 1, the data must resolve to a Simulink.Signal object that you define in the model workspace or base workspace. The default value is 0, indicating that the data does not have to resolve to a signal object. Equivalent to setting Data must resolve to Simulink signal object in the Data properties dialog box. | |
Props. | String | RW | If Props.Type.Method is Bus Object, you must set this property to the name of the Simulink.Bus object that defines this data (see Working with Structures and Bus Signals in Stateflow Charts in the Stateflow documentation). Equivalent to setting the data type Mode to Bus Object, and entering the name of a Simulink.Bus object in the Data Type Assistant of the Data properties dialog box. | |
Props. | String | RW | If Props.Type.Method is Enumerated, you must set this property to the name of the enumerated type that defines this data (see Using Enumerated Data in Stateflow Charts in the Stateflow documentation). Equivalent to setting the data type Mode to Enumerated, and entering the name of an enumerated type in the Data Type Assistant of the Data properties dialog box. | |
Props. | String | RW | If Props.Type.Method is Expression, you must set this property to an expression that evaluates to a data type (see Entering Expressions and Parameters for Data Properties in the Stateflow documentation). Equivalent to setting the data type Mode to Expression, and entering an expression in the Data Type Assistant of the Data properties dialog box. | |
Props. | String | RW | The bias value for fixed-point data (default = 0.0) when Props.Type.Fixpt.ScalingMode equals Slope and bias; otherwise this value is ignored. Equivalent to entering a real number in the Bias field of the Data Type Assistant in the Data properties dialog box. | |
Props. | String | RW | The location of the binary point in fixed-point data (default = 0) when Props.Type.Fixpt.ScalingMode equals Binary point; otherwise this value is ignored. Equivalent to entering a positive or negative integer in the Fraction length field of the Data Type Assistant in the Data properties dialog box. | |
Props. | Integer | RW | If set to 1 (default = 0), prevents Simulink software from replacing the current fixed-point type with a type that the Fixed-Point Tool or Fixed-Point Advisor chooses. Equivalent to selecting Lock data type setting against changes by the fixed-point tools in the Data properties dialog box. | |
Props. | String | RW | Method for scaling fixed point data to avoid overflow conditions and minimize quantization errors. The settings are:
Equivalent to setting the Scaling field of the Data Type Assistant in the Data properties dialog box. | |
Props. | String | RW | The slope value for fixed-point data (default = 1.0) when Props.Type.Fixpt.ScalingMode equals Slope and bias; otherwise this value is ignored. Equivalent to entering a positive real number in the Slope field of the Data Type Assistant in the Data properties dialog box. | |
Props. | String | RW | Method for setting the type of this data, based on scope:
Equivalent to setting the Mode field of the Data Type Assistant in the Data properties dialog box. | |
Props. | Integer | RW | If set to 1, indicates that fixed-point data should be signed. The default value is 0, indicating that the data is unsigned. Equivalent to setting the Signedness field of the Data Type Assistant in the Data properties dialog box. | |
Props. | String | RW | Units of measurement for the data value (default = ''). | |
Props. | String | RW | Size in bits of the word that will hold the quantized integer of fixed-point data. Equivalent to entering an integer in the Word length field of the Data Type Assistant in the Data properties dialog box. | |
SaveTo | Integer | RW | If set to 1 (default = 0), this data is saved to the MATLAB workspace. Setting this property to 1 is equivalent to selecting the SaveToWorkspace column entry for this data in the Model Explorer or selecting the Save final value to base workspace field in the Data properties dialog box. | |
Scope | Enum | RW | Scope of this data:
Equivalent to setting the Scope field in the Data properties dialog box. See Scope in the Stateflow documentation. | |
TestPoint | Integer | RW | If set to 1 (default = 0), sets this data as a Stateflow test point. You can monitor individual Stateflow test points with a floating scope during model simulation. You can also log test point values into MATLAB workspace objects. See Monitoring Test Points in Stateflow Charts in the Stateflow documentation. |
The following properties control values used in debugging Stateflow chart applications with the Stateflow Debugger.
Property | Type | Access | Description | Objects |
|---|---|---|---|---|
Debug. | Double | RW | Specify a delay (slow down) value for animation. Equivalent to setting the Delay (sec) field in the Debugger window. | |
Debug. | Boolean | RW | If true, animation (simulation) is enabled. If false (=0), disabled. Equivalent to selecting the Enabled or Disabled radio button in the Debugger window. | |
Debug. | Boolean | RW | If true, sets the chart entry breakpoint for all charts in this machine. Equivalent to selecting the Chart Entry check box in the Debugger window. | |
Debug. | Boolean | RW | If true, sets the event broadcast breakpoint for all charts in this machine. Equivalent to selecting the Event Broadcast check box in the Debugger window. | |
Debug. | Boolean | RW | If true, sets the state entry breakpoint for all states in this machine. Equivalent to selecting the State Entry check box in the Debugger window. | |
Debug. | Boolean | RW | If true, sets a debugger breakpoint for the end of the broadcast of this event. Equivalent to selecting the End of broadcast check box in the Event properties dialog box. | |
Debug. | Boolean | RW | If true, sets a debugger breakpoint for the start of the broadcast of this event. Equivalent to selecting the Start of broadcast check box in the Event properties dialog box. | |
Debug. | Boolean | RW | If true, sets the during breakpoint for this object. Equivalent to selecting the State During check box in the properties dialog box for this state or atomic subchart, or selecting the Function Call check box in the properties dialog box for this graphical function or truth table. | |
Debug. | Boolean | RW | If true, sets the entry breakpoint for this object. Equivalent to selecting the Chart Entry check box in the properties dialog box for this chart, or selecting the State Entry check box in the properties dialog box for this state or atomic subchart. | |
Debug. | Boolean | RW | If true, sets the exit breakpoint for this object. Equivalent to selecting the State Exit check box in the properties dialog box for this state or atomic subchart. | |
Debug. | Boolean | RW | If true, sets a debugging breakpoint to occur when this transition is tested to see if it is a valid transition. Equivalent to selecting the When Tested check box in the properties dialog box of this transition. | |
Debug. | Boolean | RW | If true, sets a debugging breakpoint to occur when this transition has tested as valid. Equivalent to selecting the When Valid check box in the properties dialog box of this transition. | |
Debug. | Boolean | RW | If true, disables the use of all breakpoints in this machine. Equivalent to selecting the Disable all check box in the Debugger window. | |
Debug. | Boolean | RW | If true, checks for state inconsistencies during a debug session. Equivalent to selecting the State Inconsistency check box in the Debugger window. | |
Debug. | Boolean | RW | If true, checks for transition conflicts during a debug session. Equivalent to selecting the Transition Conflict check box in the Debugger window. | |
Debug. | Boolean | RW | If true, checks for cyclical behavior errors during a debug session. Equivalent to selecting the Detect Cycles check box in the Debugger window. | |
Debug. | Boolean | RW | If true, checks for data range violations during a debug session. Equivalent to selecting the Data Range check box in the Debugger window. | |
Debug. | Boolean | RW | If true, causes the Debugger window to halt execution if this data is modified. Equivalent to selecting the Watch column entry for this data in the Model Explorer or selecting the Watch in debugger check box in the Data properties dialog box. | |
TestPoint | Boolean | RW | If true (default = false), sets this data, state, or atomic subchart as a Stateflow test point. You can monitor Stateflow test points with a floating scope during simulation. You can also log test point values into MATLAB workspace objects. See Monitoring Test Points in Stateflow Charts in the Stateflow documentation. |
The following methods control the current display.
Method | Description | Objects |
|---|---|---|
Display the properties dialog box of this object. | ||
Zoom in on this object and highlight it in the editor. | ||
Highlight this graphical object in the editor. | ||
Make this object visible for editing. | ||
Causes the editor to zoom in or zoom out on this chart. |
The following properties affect the display of the current Stateflow chart.
Property | Type | Access | Description | Objects |
|---|---|---|---|---|
Visible | Boolean | RO | If true, indicates that this object is currently visible in the chart. | |
Subviewer | Chart or State | RO | Chart or state in which you can view this object graphically. | |
ZoomFactor | Double | RW | View magnification level (zoom factor) of this chart in the editor. |
The following properties set colors for the graphical objects in Stateflow charts.
Property | Type | Access | Description | Objects |
|---|---|---|---|---|
ChartColor | [R,G,B] | RW | Background color of this chart in a 1-by-3 RGB array with each value normalized on a scale of 0 to 1. | |
ErrorColor | [R,G,B] | RW | Set the RGB color for errors in the chart using a 1-by-3 RGB array with each value normalized on a scale of 0 to 1. | |
JunctionColor | [R,G,B] | RW | Set the RGB color for junctions in the chart using a 1-by-3 RGB array with each value normalized on a scale of 0 to 1. | |
SelectionColor | [R,G,B] | RW | Color of selected items for this chart in a 1-by-3 RGB array with each value normalized on a scale of 0 to 1. | |
StateColor | [R,G,B] | RW | Color of the state box in a 1-by-3 RGB array with each value normalized on a scale of 0 to 1. | |
StateLabelColor | [R,G,B] | RW | Color of the state labels for this chart in a 1-by-3 RGB array with each value normalized on a scale of 0 to 1. | |
TransitionColor | [R,G,B] | RW | Set the RGB color for transitions in the chart using a 1-by-3 RGB array with each value normalized on a scale of 0 to 1. | |
Transition LabelColor | [R,G,B] | RW | Color of the transition labels for this chart in a 1-by-3 RGB array with each value normalized on a scale of 0 to 1. |
The following properties control how Stateflow objects are drawn in their charts.
Property | Type | Access | Description | Objects |
|---|---|---|---|---|
ArrowSize | Double | RW | Size of transition arrows coming into this object. Equivalent to selecting Arrowhead Size from the context menu for this object. | |
DrawStyle | String | RW | Drawing style for this transition. Set to 'SMART' (default) for smart transitions or 'STATIC' for static transitions. Equivalent to selecting Smart from the context menu for this transition to toggle between settings. | |
Editor | Editor | RO | Editor object for this chart. |
The following properties change the font used for text in a Stateflow chart.
Property | Type | Access | Description | Objects |
|---|---|---|---|---|
Font. | Enum | RW | Style of the font for the text in this note. Can be 'ITALIC' or 'NORMAL'. This property overrides the default style for this note, which is set by the StateFont.Angle property of the Chart object containing this note. | |
Font. | String | RO | Name of the font for the text in this note. This property is read-only (RO) and set by the StateFont.Name property of the Chart object containing this note. | |
Font. | Double | RW | Size of the font for the label text for this note. This property overrides the default size for this note, which is set by the StateFont.Size property of the Chart object containing this note. Equivalent to selecting Font Size > <font size> in the context menu for this note. | |
Font. | Enum | RW | Weight of the font for the label text for this note. Can be 'BOLD' or 'NORMAL'. This property overrides the default weight for the text in this note, which is set by the StateFont.Weight property of the Chart object containing this note. | |
FontSize | Double | RW | Size of the font for the label text for this object. This property overrides the default size for this object, which is set by the StateFont.Size property (TransitionFont.Size for transitions) of the Chart object containing this object. Equivalent to selecting Font Size > <font size> in the context menu for this object. | |
StateFont. | Enum | RW | Font angle for the labels of State, Box, Function, and Note objects. Can be 'ITALIC' or 'NORMAL'. Use with property StateFont.Weight to achieve Bold Italic style. You can individually override this property with the Font.Angle property for Note objects. | |
StateFont. | String | RW | Font style used for the labels of State, Box, Function, and Note objects. Enter a string for the font name -- no selectable values. Font remains set to previous font for unrecognized font strings. | |
StateFont. | Integer | RW | Font size for the labels of State, Box, Function, and Note objects. You can individually override this property with the FontSize property for State, Box, and Function objects and with the Font.Size property for Note objects. | |
StateFont. | Enum | RW | Font weight for state labels. Can be 'BOLD' or 'NORMAL'. Use with the property StateFont.Angle to achieve Bold Italic style. You can individually override this property with the Font.Weight property for Note objects. | |
TransitionFont. | Enum | RW | Font angle for state labels. Can be 'ITALIC' or 'NORMAL'. Use with property StateFont.Weight to achieve Bold Italic style. | |
TransitionFont. | String | RW | Font used for transition labels. Enter string for font name (no selectable values). Font remains set to previous font for unrecognized font strings. | |
TransitionFont. | Integer | RW | Default font size for transition labels. Truncated to closest whole number less than or equal to entered value. | |
TransitionFont. | Enum | RW | Font weight for transition labels. Can be 'BOLD' or 'NORMAL'. Use with property StateFont.Angle to achieve Bold Italic style. |
The following properties control the position of Stateflow objects in a Stateflow chart.
Property | Type | Access | Description | Objects |
|---|---|---|---|---|
BadIntersection | Boolean | RO | If true, this object graphically intersects another state, box, or function in an invalid way. | |
Destination | State, Box, or Junction | RW | Destination state, box, or junction of this transition. You can also use the property Destination to detach the destination endpoint of a transition, with the command t.Destination = [], where t is the Transition object. | |
DestinationEndPoint | Double | RW | Provides [x y] coordinates for the transition endpoint at its destination. The coordinates are relative to the upper left corner of the chart, which is [0 0]. If you enter non-integer values, only the integer part of the value is used. If you enter negative values for the coordinates, [0 0] is used instead. | |
DestinationOClock | Double | RW | Location of transition destination connection on state. Varies from 0 to 12 for full clock cycle location. Value taken as modulus 12 of entered value. | |
LabelPosition | Rect | RW | Position and size of this transition label in the chart, given in the form of a 1-by-4 array that includes:
| |
MidPoint | Rect | RW | Provides [x y] coordinates of the transition midpoint relative to the upper left corner of the chart, which is [0 0]. | |
Position | Rect | RW | Position and size of box-like objects in the chart, given in the form of a 1-by-4 array that includes:
| |
Position. | Rect | RW | (x,y) position of junction relative to the upper left vertex of the parent chart or state. | |
Position. | Double | RW | Radius of this junction. | |
Source | State, Box, or Junction | RW | Source state, box, or junction of this transition. You can also use the property Source to detach the source endpoint of a transition, with the command t.Source = [], where t is the Transition object. | |
SourceEndPoint | Double | RW | Provides [x y] coordinates for the transition endpoint at its source. The coordinates are relative to the upper left corner of the chart, which is [0 0]. If you enter non-integer values, only the integer part of the value is used. If you enter negative values for the coordinates, [0 0] is used instead. | |
SourceOClock | Double | RW | Location of transition source connection on state. Varies from 0 to 12 for full clock cycle location. Value taken as modulus 12 of entered value. | |
WindowPosition | Rect | RW | Position and size of this chart given in the form of a 1-by-4 array consisting of the following:
|
The following properties control the text and text appearance apart from font and color in Stateflow charts.
Property | Type | Access | Description | Objects |
|---|---|---|---|---|
Alignment | Enum | RW | Alignment of text in note box. Can be 'LEFT', 'CENTER', or 'RIGHT'. | |
Interpretation | Enum | RW | How the text in this note is interpreted for text processing. Can be 'NORMAL' or 'TEX'. | |
LabelString | String | RW | Label for this object. Equivalent to typing the label for this object in its label text field in the chart. | |
Text | String | RW | Label for this note. The text content for this note that you enter directly into the note in the chart or in the Label field of the Note properties dialog box. |
The following properties identify objects for the version of Stateflow software.
Property | Type | Access | Description | Objects |
|---|---|---|---|---|
Description | String | RW | Description of this object. Equivalent to entering a description in the Description field of the properties dialog box for this object (except for Simulink functions). | |
Document | String | RW | Document link for this object. Equivalent to entering a link in the Document link field of the properties dialog box for this object (except for Simulink functions). | |
Id | Integer | RO | Unique identifier assigned to this object to distinguish it from other objects loaded in memory. | |
Name | String | RW | Name of this object. This property is RW except for the name of a Machine object, which is RO. | |
SfVersion | Double | RO | Full version number for current Stateflow software. For example, the string '41112101' appears for Stateflow software version 4.1.1 and MATLAB software version 12.1. The remaining '01' is for internal use. | |
Tag | Any Type | RW | A field you can use to hold data of any type for this object. | |
Type | Enum | RO | Type of this state or junction. For states, can be one of the following:
The type of a state is determined by the parent's Decomposition property. For junctions, can be one of the following:
|
The following properties (and methods) control how data and events are input from and output to the Simulink model for a Stateflow chart.
Property (Method) | Type | Access | Description | Objects |
|---|---|---|---|---|
ChartUpdate | Enum | RW | Activation method of this chart. Can be one of the following:
These preceding entries are equivalent to the parenthetical entries for the Update method field in the Chart properties dialog box. | |
ExecuteAtInitialization | Boolean | RW | If set to true, initialize this chart's state configuration at time zero instead of at first input event. Equivalent to selecting the Execute (enter) Chart At Initialization check box in the Chart properties dialog box. | |
ExportChartFunctions | Boolean | RW | If set to true (default = false), graphical functions at chart level are made global. Equivalent to selecting the Export Chart Level Graphical Functions (Make Global) check box in the Chart properties dialog box. | |
| InitializeOutput | Boolean | RW | Applies the initial value of outputs every time a chart wakes up, not only at time 0. See Setting Properties for a Single Chart. | |
(outputData) | No Return | NA | Output the activity status of this state to the Simulink base workspace via a data output port on the Chart block of this state. | |
Port | Integer | RW | Port index number for this input or output data or event (default = 1). | |
SampleTime | String | RW | Sample time for activating this chart. Applies only when the ChartUpdate property for this chart is set to 'DISCRETE' ( = Discrete in the Update method field in the Chart properties dialog box). | |
SaveToWorkspace | Boolean | RW | If set to true, this data is saved to the MATLAB workspace. Equivalent to selecting the SaveToWorkspace column entry for this data in the Model Explorer or selecting the Save final value to base workspace field in the Data properties dialog box. | |
Scope | Enum | RW | Scope of this data. Allowed values vary with the object containing this data, which are as follows:
Above values correspond to entries in the Scope field of the Data or Event properties dialog box. | |
StrongDataTyping | Boolean | RW | If set to true, set strong data typing with Simulink I/O. Equivalent to selecting the Use Strong Data Typing with Simulink I/O check box in the Chart properties dialog box. | |
Trigger | Enum | RW | Type of signal that triggers this chart input event. Also the type of trigger associated with this chart output event. The following triggers apply to both chart input and output events:
The following triggers apply only to chart input events:
The preceding entries are equivalent to the entries in parentheses for the Trigger field in the Event properties dialog box. |
The following properties allow you to manage logging for local data and state activity.
Property | Type | Access | Description | Objects |
|---|---|---|---|---|
LoggingInfo. | Boolean | RW | Signal logging mode:
| |
LoggingInfo. | Boolean | RW | Limit the amount of data logged by skipping samples.
Uses the interval specified by LoggingInfo.
| |
LoggingInfo. | Integer | RW | Decimation interval. Default value is 2, which means the chart logs every other sample. | |
LoggingInfo. | Boolean | RW | Limit number of data points to log. Uses the value specified
by LoggingInfo.
| |
LoggingInfo. | Integer | RW | Maximum number of data points to log. Default value is 5000, which means the chart logs the last 5000 data points generated by the simulation. | |
LoggingInfo. | String | RW | Source of signal logging name:
| |
LooggingInfo. | String | RW | User-specified (custom) signal logging name. |
The following properties identify parts of the Simulink model containing a Stateflow chart.
Property | Type | Access | Description | Objects |
|---|---|---|---|---|
Created | String | RO | Date of creation of this machine. | |
Creator | String | RW | Creator of this machine. | |
Dirty | Boolean | RW | If true, this object has changed since it was opened or saved. | |
FullFileName | String | RO | Full path name of file under which this machine (model) is stored. | |
Iced | Boolean | RO | Equivalent to property Locked except that this property is used internally to lock this object from being changed during activities such as simulation. | |
IsLibrary | Boolean | RO | If true, specifies that the current model builds a library and not an application. | |
Locked | Boolean | RW | If set to true, prevents user from changing any Stateflow chart in this machine or chart. | |
Modified | String | RW | Comment area for entering date and name of modification to this machine (model). | |
Version | String | RW | Comment string for recording version of this model. |
The following properties control the definition of a truth table.
Property | Type | Access | Description | Objects |
|---|---|---|---|---|
ActionTable | Cell Array | RW | A cell array of strings containing the contents of the Action Table for this truth table. | |
ConditionTable | Cell Array | RW | A cell array of strings containing the contents of the Action Table for this truth table. | |
OverSpec Diagnostic | String | RW | Interprets the error diagnosis of this truth table as overspecified according to the possible values 'Error', 'Warning', or 'None'. In the Truth Table Editor, the value of this property is assigned by selecting Overspecified from the Settings menu item and then selecting one of the three values. | |
UnderSpec Diagnostic | String | RW | Interprets the error diagnosis of this truth table as underspecified according to the possible values 'Error', 'Warning', or 'None'. In the Truth Table Editor, the value of this property is assigned by selecting Underspecified from the Settings menu item and then selecting one of the three values. |
![]() | API Object Properties and Methods | API Method Reference | ![]() |

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 |