API Object Reference


Reference Table Column DescriptionsDescribes the columns in the tables that list properties and methods of the Stateflow® API.
All Object MethodsDescribes methods that belong to all Stateflow® objects.
Box PropertiesDescriptions of properties for Box objects (boxes) in the Stateflow® API.
Box MethodsDescriptions of methods for Box objects (boxes) in the Stateflow® API.
Chart PropertiesDescriptions of properties for Chart objects (charts) in the Stateflow® API.
Chart MethodsDescriptions of methods for Chart objects (charts) in the Stateflow® API.
Clipboard MethodsDescriptions of the methods of the Clipboard used for copying and pasting objects from chart to chart.
Constructor MethodsConstruct Stateflow® objects
Data PropertiesDescription of properties for Data objects (data) in the Stateflow® API.
Data MethodsDescription of methods for Data objects (data) in the Stateflow® API.
Editor PropertiesDescriptions of properties for the Editor object in the Stateflow® API.
Editor MethodsDescriptions of methods for the Editor object in the Stateflow® API.
Embedded MATLAB™ Function PropertiesDescriptions of properties for Embedded MATLAB™ Function objects in the Stateflow® API.
Embedded MATLAB™ Function MethodsDescriptions of methods for Embedded MATLAB™ Function objects in the Stateflow® API.
Event PropertiesDescriptions of properties for Event objects in the Stateflow® API.
Event MethodsDescriptions of methods for Event objects in the Stateflow® API.
Graphical Function PropertiesDescriptions of properties for Function objects (graphical functions) in the Stateflow® API.
Graphical Function MethodsDescriptions of methods for Function objects (graphical functions) in the Stateflow® API.
Junction PropertiesDescriptions of properties for Junction objects (junctions) in the Stateflow® API.
Junction MethodsDescriptions of methods for Junction objects (junctions) in the Stateflow® API.
Machine PropertiesDescriptions of properties for the Machine object (model) in the Stateflow® API.
Machine MethodsDescriptions of methods for the Machine object (model) in the Stateflow® API.
Note PropertiesDescriptions of properties for Note objects (notes) in the Stateflow® API.
Note MethodsDescriptions of methods for Note objects (notes) in the Stateflow® API.
Root MethodsDescription of the methods of the Root object that contains all other Stateflow® objects
State PropertiesDescriptions of properties for State objects (states) in the Stateflow® API.
State MethodsDescriptions of methods for State objects (states) in the Stateflow® API.
Target PropertiesDescriptions of properties for Target objects (targets) in the Stateflow® API.
Target MethodsDescriptions of methods for Target objects (targets) in the Stateflow® API.
Transition PropertiesDescriptions of properties for Transition objects (transitions) in the Stateflow® API.
Transition MethodsDescriptions of properties and methods for Transition objects (transitions) in the Stateflow® API.
Truth Table PropertiesDescriptions of properties for Truth Table objects in Stateflow® API.
Truth Table MethodsDescriptions of methods for Truth Table objects in Stateflow® API.
Truth Table Chart PropertiesDescriptions of properties for Truth Table Chart objects in the Stateflow® API.
Truth Table Chart MethodsDescriptions of methods for Truth Table Chart objects in Stateflow® API.

Reference Table Column Descriptions

Reference tables for Stateflow® API properties and methods have these columns:

All Object Methods

The following methods apply to all API objects including those of Stateflow® charts. Only object-exclusive methods appear when you use the method methods to display methods for an object. However, the tables of methods for each API object that follow do list these methods as if they were their own.

For details on each method, see API Method Reference.

Method

Description

delete

Delete this object. Used with all objects except the Root, Machine, Chart, Clipboard, and Editor objects.

disp

Display the property names and their settings for this object.

find

Find all objects of this object that meet the specified criteria.

get

Return the specified property settings for this object.

methods

Display all nonglobal methods of this object.

set

Set the specified property of this object with a specified value.

struct

Return and display a MATLAB® structure containing the property settings of this object.

up

Return the parent (container) object of this object.

Box Properties

Stateflow® API objects of type Box have the properties shown below. See also Box Methods.

Property

Type

Access

Description

ArrowSize

Double

RW

Size of transition arrows coming into this box (default = 8). Equivalent to selecting Arrowhead Size from the context menu for this box.

BadIntersection

Boolean

RO

If true, this box graphically intersects a state, Embedded MATLAB™ function, graphical function, truth table, or another box.

Chart

Chart

RO

Chart object containing this box.

Description

String

RW

Description of this box (default = ''). Equivalent to entering a description in the Description field of the Box properties dialog.

Document

String

RW

Document link to this box (default = ''). Equivalent to entering the Document Link field of the Box properties dialog.

FontSize

Double

RW

Size of the font (default = 12) for the label text of this box. This property overrides the font size set for this box at creation by the StateFont.Size property of the containing Chart's object. Equivalent to selecting Font Size > <font size> in the context menu for this box.

Id

Integer

RO

Unique identifier assigned to this box to distinguish it from other objects loaded in memory.

IsGrouped

Boolean

RW

If set to true (default = false), group this box.

IsSubchart

Boolean

RW

If set to true (default = false), make this box a subchart.

LabelString

String

RW

Label for this box (default = '?'). Equivalent to typing the label for this box in its label text field in the Stateflow Editor.

Machine

Machine

RO

Machine that contains this box.

Name

String

RW

Name of this box (default = ''). Equivalent to typing this box's name into the beginning of the label text field for this box in the Stateflow Editor.

Position

Rect

RW

Position and size of this box in the Stateflow chart, given in the form of a 1-by-4 array (default is [0 0 90 60]) consisting of the following:

  • (x,y) coordinates for the box's left upper vertex relative to the upper left vertex of the Stateflow Editor workspace

  • Width and height of the box

Subviewer

Chart or State

RO

State or chart in which this box can be graphically viewed.

Tag

Any Type

RW

Holds data of any type (default = []) for this box.

Box Methods

Box objects have the methods in the table below. For details on each method, see API Method Reference.

See also Box Properties.

Method

Description

defaultTransitions

Return the default transitions in this box at the top level of containment.

delete

Delete this box from the Stateflow® chart.

dialog

Display the Box properties dialog.

disp

Display the property names and their settings for this Box object.

find

Find all objects that this box contains that meet the specified criteria.

fitToView

Zoom in on this box and highlight it in the Stateflow Editor.

get

Return the specified property settings for this box.

help

Display a list of properties for this Box object with short descriptions.

innerTransitions

Return the inner transitions that originate with this box and terminate on a contained object.

methods

Display all nonglobal methods of this Box object.

outerTransitions

Return an array of transitions that exit the outer edge of this box and terminate on an object outside the containment of this box.

set

Set the specified property of this Box object with the specified value.

sourcedTransitions

Return all inner and outer transitions whose source is this box.

struct

Return and display a MATLAB® structure containing the property settings of this Box object.

view

Display this box's chart in the Stateflow Editor with this box highlighted.

Chart Properties

Stateflow® API objects of type Chart have the properties shown below. See also Chart Methods.

Property

Type

Access

Description

ChartColor

[R,G,B]

RW

Background color of this chart in a 1-by-3 RGB array (default = [1 0.9608 0.8824])with each value normalized on a scale of 0 to 1.

ChartUpdate

Enum

RW

Activation method of this chart. Can be 'INHERITED' (default), 'DISCRETE', or 'CONTINUOUS'. Equivalent to the Update method field in the Chart properties dialog, which takes one of these selections: Inherited, Discrete, Continuous.

Debug.
Breakpoints.
OnEntry

Boolean

RW

If set to true (default = false), set the chart entry breakpoint for this chart. Equivalent to selecting the Chart Entry check box in the Chart properties dialog.

Decomposition

Enum

RW

Set this property to 'EXCLUSIVE_OR' (default) to specify exclusive (OR) decomposition for the states at the first level of containment in this chart.

Set to 'PARALLEL_AND' to specify parallel (AND) decomposition for these states. Equivalent to the Decomposition selection in the context menu for the Stateflow Editor.

Description

String

RW

Description (default = '') of this state. Equivalent to entering a description in the Description field of the Chart properties dialog.

Dirty

Boolean

RW

If set to true (default = false), this chart has changed since being opened or saved.

Document

String

RW

Document link (default = '') to this chart. Equivalent to entering a link in the Document Link field of the Chart properties dialog.

Editor

Editor

RO

Editor object for this chart.

EnableBitOps

Boolean

RW

If set to true (default = false), enables 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.

EnableNonTerminalStates

Boolean

RW

If set to true (default = false), enables super step semantics for the chart, as described in Executing a Chart with Super Step Semantics in the Stateflow and Stateflow® Coder™ User's Guide.

EnableZeroCrossings

Boolean

RW

If set to true (default = true), enables zero-crossing detection on state transitions for continuous-time simulation of Stateflow charts. Applies only when the ChartUpdate property for this chart is set to 'CONTINUOUS'. See When to Enable Zero-Crossing Detection in the Stateflow and Stateflow Coder User's Guide.

ErrorColor

[R,G,B]

RW

Set the RGB color for errors in the Stateflow Editor in a 1-by-3 RGB array (default value [1 0 0]) with each value normalized on a scale of 0 to 1. Equivalent to changing the Error color in the Colors & Fonts dialog under Edit > Style.

ExecuteAtInitialization

Boolean

RW

If set to true (default = false), this chart's state configuration is initialized at time zero instead of at the first input event. Equivalent to selecting the Execute (enter) Chart At Initialization check box in the Chart properties dialog.

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.

Iced

Boolean

RO

Equivalent to property Locked (default = false) except that this property is used internally to lock this chart from change during activities such as simulation.

Id

Integer

RO

Unique identifier assigned to this chart to distinguish it from other objects loaded in memory.

InitializeOutputBooleanRWApplies the initial value of outputs every time a chart wakes up, not only at time 0. See Setting Properties for Individual Charts.

JunctionColor

[R,G,B]

RW

Set the RGB color for junctions in the Stateflow Editor in a 1-by-3 RGB array (default value [0.6824 0.3294 0]) with each value normalized on a scale of 0 to 1. Equivalent to changing the Junction color in the Colors & Fonts dialog under Edit > Style.

Locked

Boolean

RW

If set to true (default = false), mark this chart as read-only and prohibit any write operations on it. Equivalent to selecting the Lock Editor check box in the Chart properties dialog.

Machine

Machine

RO

Machine that contains this chart.

Name

String

RW

Name of this chart (default = 'Chart'). Equivalent to changing the name of this chart's Stateflow block in a Simulink® model.

NonTerminalMaxCounts

String

RW

Maximum number of transitions a Stateflow chart can take in one super step. Applies only when EnableNonTerminalStates is true. See Executing a Chart with Super Step Semantics in the Stateflow and Stateflow Coder User's Guide.

NonTerminalUnstableBehavior

Enum

RW

Behavior of a Stateflow chart during simulation if it exceeds the maximum number of transitions specified in the NonTerminalMaxCounts property in a super step before reaching a stable state. Set this property to 'PROCEED' (default) if you want the chart to go back to sleep with the last active state configuration. Set this property to 'THROW ERROR' if you want the chart to generate an error. Applies only when EnableNonTerminalStates is true. See Executing a Chart with Super Step Semantics in the Stateflow and Stateflow Coder User's Guide.

SampleTime

String

RW

Sample time for activating this chart (default = ''). Applies only when the ChartUpdate property for this chart is set to 'DISCRETE' ( = Discrete in the Update method field in the Chart properties dialog).

SelectionColor

[R,G,B]

RW

Color of selected items for this chart in a 1-by-3 RGB array (default value [1 0 0.5176]) with each value normalized on a scale of 0 to 1. Equivalent to changing the Selection color in the Colors & Fonts dialog under Edit > Style.

StateColor

[R,G,B]

RW

Color of the state box in a 1-by-3 RGB array (default value [0 0 0]) with each value normalized on a scale of 0 to 1. Equivalent to changing the State/Frame color in the Colors & Fonts dialog under Edit > Style.

StateFont.
Angle

Enum

RW

Font angle for the labels of State, Box, Function, and Note objects. Can be 'ITALIC' or 'NORMAL' (default). Equivalent to Italic and Regular settings when changing the font style of StateLabel in the Colors & Fonts dialog under Edit > Style. 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.
Name

String

RW

Font style (default = 'Helvetica') used for the labels of State, Box, Function, and Note objects. Enter a string for the font name (there are no selectable values). Font remains set to previous font for unrecognized font strings. Equivalent to changing the font of StateLabel in the Colors & Fonts dialog under Edit > Style.

StateFont.
Size

Integer

RW

Default font size for the labels of a new State, Box, Function, or Note object. Equivalent to changing the font size of StateLabel in the Colors & Fonts dialog under Edit > Style.

You can change the font size for an existing State, Box, or Function object with the FontSize property of that object. You can change the font size for an existing Note object with its Font.Size property.

StateFont.
Weight

Enum

RW

Font weight for state labels. Can be 'BOLD' or 'NORMAL' (default). Equivalent to the Bold and Regular settings of StateLabel in the Colors & Fonts dialog under Edit > Style. 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.

StateLabelColor

[R,G,B]

RW

Color of the state labels for this chart in a 1-by-3 RGB array (default = [0 0 0]) with each value normalized on a scale of 0 to 1. Equivalent to changing the label color of StateLabel in the Colors & Fonts dialog under Edit > Style.

StateMachineType

Enum

RW

Type of state chart to create. Default is Classic, which provides the full set of Stateflow chart semantics. You can also create Mealy and Moore charts, which use a subset of Stateflow chart semantics (see Building Mealy and Moore Charts).

StrongDataTyping
WithSimulink

Boolean

RW

If set to true (default), 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.

Tag

Any Type

RW

A field you can use to hold data of any type for this chart (default = []).

TransitionColor

[R,G,B]

RW

Set the RGB color for transitions in the Stateflow Editor in a 1-by-3 RGB array (default = [0.2902 0.3294 0.6039]) with each value normalized on a scale of 0 to 1. Equivalent to changing the Transition color in the Colors & Fonts dialog under Edit > Style.

TransitionFont.
Angle

Enum

RW

Font angle for state labels. Can be 'ITALIC' or 'NORMAL' (default). Equivalent to Italic and Regular settings when you change the font style of TransitionLabel in the Colors & Fonts dialog under Edit > Style. Use with property StateFont.Weight to achieve Bold Italic style.

TransitionFont.
Name

String

RW

Font style (default = 'Helvetica') used for transition labels. Enter a string for font name (there are no selectable values). Font remains set to previous font for unrecognized font strings. Equivalent to changing the font of TransitionLabel in the Colors & Fonts dialog under Edit > Style.

TransitionFont.
Size

Integer

RW

Default font size (default = 12) for transition labels. Truncated to closest whole number less than or equal to entered value. Equivalent to changing the font size of TransitionLabel in the Colors & Fonts dialog under Edit > Style.

TransitionFont.
Weight

Enum

RW

Font weight for transition labels. Can be 'BOLD' or 'NORMAL' (default). Equivalent to Bold and Regular settings when you change the font style of TransitionLabel in the Colors & Fonts dialog under Edit > Style. Use with property StateFont.Angle to achieve Bold Italic style.

TransitionLabel
Color

[R,G,B]

RW

Color of the transition labels for this chart in a 1-by-3 RGB array (default = [0.2902 0.3294 0.6039]) with each value normalized on a scale of 0 to 1. Equivalent to changing the label color of TransitionLabel in the Colors & Fonts dialog under Edit > Style.

UserSpecifiedState
TransitionExecutionOrder

Boolean

RW

If set to true (default = false), you have complete control of the order in which transitions originating from a source are tested for execution. Equivalent to selecting the User specified state/transition execution order check box in the Chart properties dialog.

Visible

Boolean

RW

If set to true (default), display this chart in the Stateflow Editor.

Chart Methods

Chart objects have the methods in the table below. For details on each method, see API Method Reference.

See also Chart Properties.

Method

Description

defaultTransitions

Return the default transitions in this Stateflow® chart at the top level of containment.

dialog

Display the Chart properties dialog.

disp

Display the property names and their settings for this Chart object.

find

Find all objects that this chart contains that meet the specified criteria.

fitToView

Zoom in on this chart in the Stateflow Editor.

get

Return the specified property settings for this chart.

help

Display a list of properties for this Chart object with short descriptions.

methods

Display all nonglobal methods of this Chart object.

parse

Parse this chart.

set

Set the specified property of this Chart object with the specified value.

struct

Return and display a MATLAB® structure containing the property settings of this Chart object.

view

Display this chart in the Stateflow Editor.

Clipboard Methods

The Clipboard object has the methods in the table below. For details on each method, see API Method Reference.

Method

Description

copy

Copy the objects specified to this Clipboard object.

get

Return the specified property settings for this Clipboard object.

help

Display a list of properties for this Clipboard object with short descriptions.

methods

Display all nonglobal methods of this Clipboard object.

pasteTo

Paste the contents of this clipboard to the specified container object.

set

Set the specified property of this Clipboard object with the specified value.

struct

Return and display a MATLAB® structure containing the property settings of this Clipboard object.

Constructor Methods

The following methods create a new Stateflow® object for a parent object specified as an argument in the general expression o = Stateflow.Object(p), where o is a handle to an API object for the new Stateflow object, p is a handle to the parent object, and Object is the type of the object:

For details on each method, see API Method Reference.

Method

Description

Stateflow.Box

Create a box for a parent chart, state, box, or function.

Stateflow.Data

Create a data for a parent machine, chart, state, box, or function.

Stateflow.EMFunction

Create an Embedded MATLAB™ function for a parent chart or state.

Stateflow.Event

Create an event for a parent machine, chart, state, box, or function.

Stateflow.Function

Create a graphical function for a parent chart, state, box, or function.

Stateflow.Junction

Create a junction for a parent chart, state, box, or function.

Stateflow.Note

Create a note for a parent chart, state, box, or function.

Stateflow.State

Create a state for a parent chart, state, box, or function.

Stateflow.Target

Create a target for a parent machine.

Stateflow.Transition

Create a transition for a parent chart, state, box, or function.

Stateflow.TruthTable

Create a truth table for a parent chart or state.

Data Properties

Stateflow® API objects of type Data have the properties shown below. See also Data Methods.

Property

Type

Access

Description

CompiledSize

String

RW

Size of data as determined by the compiler.

CompiledType

String

RW

Type of data as determined by the compiler.

Debug.
Watch

Integer

RW

If set to 1 (default = 0), causes the Debugger window to halt execution if this data is modified. Setting this property to 1 is equivalent to selecting the Watch in debugger check box in the Data properties dialog.

Description

String

RW

Description of this data (default = ''). Equivalent to entering a description in the Description field of the Data properties dialog.

Document

String

RW

Document link to this data (default = ''). Equivalent to entering a link in the Document link field of the Data properties dialog.

Id

Integer

RO

Unique identifier assigned to this data to distinguish it from other objects in the model.

InitializeMethod

String

RW

Method for initializing value of this data, based on scope of data:

  • If scope is Local or Output, you can set InitializeMethod to Expression or Parameter. Equivalent to setting the Initial value field in the Data properties dialog.

  • If scope is Parameter, Input, or Data Store Memory, you should set InitializeMethod to Not Needed as a read-only property.

  • If scope is Constant, you should set InitializeMethod to Expression as a read-only property.

Machine

Machine

RO

Stateflow machine that contains this data.

Name

String

RW

Name of this data. Equivalent to entering the name of this data in the Name field of the Data properties dialog.

OutputState

Integer

RO

If set to 1 (default = 0), this data represents the activity of the state in which it is defined as an output to a Simulink® model. See Outputting State Activity to a Simulink® Model in the Stateflow and Stateflow® Coder™ User's Guide. Create this data for a state by using the State method outputData. Equivalent to selecting the Output State Activity check box for the state.

Path

String

RO

Location of this data in the model hierarchy

Port

Integer

RW

Port index number for this data (default = 1).

Props.
Array.
FirstIndex

String

RW

Index of the first element of this data (default = 0) if it is an array (that is, Props.Array.Size > 1). Equivalent to entering a value of zero or greater in the First index field in the Data properties dialog.

Props.
Array.
Size

String

RW

Size of this data. Assigning a positive value indicates that the data is an array of the specified size (default = 0). Equivalent to entering a positive value in the Size column for this data in the Model Explorer or the Size field in the Data properties dialog.

Props.
Initial
Value

String

RW

Initial value of this data (default = ''). Equivalent to entering a value in the Initial value column for this data in the Model Explorer or theInitial value field in the Data properties dialog.

Props.
Range.
Maximum

String

RW

Maximum value (default = '') that this data can have during execution or simulation of the state machine. Equivalent to entering a value in the Maximum column for this data in the Model Explorer or the Maximum field in the Data properties dialog.

Props.
Range.
Minimum

String

RW

Minimum value (default = '') that this data can have during execution or simulation of the state machine. Equivalent to entering a value in the Minimum column for this data in the Model Explorer or the Minimum field in the Data properties dialog.

Props.
Type.
BusObject

String

RW

If Props.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 and Stateflow Coder User's Guide). 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.

Props.
Type.
Expression

String

RW

If Props.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 and Stateflow Coder User's Guide). Equivalent to setting the data type Mode to Expression, and entering an expression in the Data Type Assistant of the Data properties dialog.

Props.
Type.
Fixpt.
Bias

String

RW

The bias value for fixed-point data (default = 0.0) ifProps.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.

Props.
Type.
Fixpt.
FractionLength

String

RW

The location of the binary point in fixed-point data (default = 0) if 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.

Props.
Type.
Fixpt.
Lock

Integer

RW

If set to 1 (default = 0), prevents a Simulink model from replacing the current fixed-point type with a type chosen by the autoscaling tool. Equivalent to selecting Lock output scaling against changes by the autoscaling tool in the Data properties dialog.

Props.
Type.
Fixpt.
ScalingMode

String

RW

Method for scaling fixed point data to avoid overflow conditions and minimize quantization errors. There are three settings:

  • None (the default)

  • Binary point

  • Slope and bias

Equivalent to setting the Scaling field of the Data Type Assistant in the Data properties dialog.

Props.
Type.
Fixpt.
Slope

String

RW

The slope value for fixed-point data (default = 1.0) ifProps.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.

Props.
Type.
Method

String

RW

Method for setting the type of this data, based on scope:

  • If scope is Local , you can set this property to Built-in, Expression, Bus Object, or Fixed point.

  • If scope is Constant, you can set this property to Built-in, Expression, or Fixed point.

  • If scope is Parameter, you can set this property to Inherited, Built-in, Expression, or Fixed point.

  • If scope is Input or Output, you can set this property to Inherited, Built-in, Expression, Bus Object, or Fixed point.

  • If scope is Data Store Memory, you should set Props.Type.Method to Inherited as a read-only property.

Equivalent to setting the Mode field of the Data Type Assistant in the Data properties dialog.

Props.
Type.
Signed

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 Sign field of the Data Type Assistant in the Data properties dialog.

Props.
Type.
Units

String

RW

Units of measurement for the data value (default = '').

Props.
Type.
WordLength

String

RW

Size in bits of the word that will hold the quantized integer of fixed-point data. Equivalent to entering an integer between 0 and 32 in the Word length field of the Data Type Assistant in the Data properties dialog.

Props.
SaveToWorkspace

Integer

RW

If set to 1, assigns the value of the data item to a variable of the same name in the model workspace at the end of simulation. The default value is 0, indicating that the data is not saved to the base workspace. Equivalent to selecting the check box Save final value to base workspace in the Data properties dialog.

Scope

Enum

RW

Scope of this data:

  • Local — Data defined in current Stateflow chart.

  • Constant — Read-only constant value that is visible to the parent Stateflow object and its children.

  • Parameter — Constant defined in the MATLAB® workspace or derived from a Simulink parameter that is defined and initialized in the parent masked subsystem.

  • Input — If the parent is a graphical, truth table, or Embedded MATLAB™ function, the data is an input argument. Otherwise, it is provided by the Simulink model to the Stateflow chart via an input port.

  • Output — If the parent is a graphical, truth table, or Embedded MATLAB function, the data is a return value. Otherwise, it is provided by the Stateflow chart to the Simulink model via an output port.

  • Data Store Memory — Data that binds to a Simulink data store.

  • Temporary — Data that persists only during the execution of a function.

  • Imported — Data parented by the Simulink model, but defined in external code embedded in the Stateflow machine.

  • Exported — Data from the Simulink model that you provide to external code. Parent must be a Stateflow machine.

Equivalent to setting the Scope field in the Data properties dialog. See Scope in the Stateflow and Stateflow Coder User's Guide.

SaveTo
Workspace

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.

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 and Stateflow Coder User's Guide.

Data Methods

Data objects have the methods in the table below. For details on each method, see API Method Reference.

See also Data Properties.

Method

Description

delete

Delete this data.

dialog

Display the Data properties dialog.

disp

Display the property names and their settings for this Data object.

get

Return the specified property settings for this data.

help

Display a list of properties for this Data object with short descriptions.

methods

Display all nonglobal methods of this Data object.

set

Set the specified property of this Data object with the specified value.

struct

Return and display a MATLAB® structure containing the property settings of this Data object.

view

Display this data in the Data properties dialog.

Editor Properties

The Editor object has the properties shown below. See also Editor Methods.

Property

Type

Access

Description

WindowPosition

Rect

RW

Position and size of this Stateflow® chart given in the form of a 1-by-4 array consisting of the following:

  • (x,y) coordinates for the window's left bottom vertex relative to the lower left corner of the screen

  • Width and height of the box

Default value = [124.3125 182.8125 417 348.75]

ZoomFactor

Double

RW

View magnification level (zoom factor) of this chart in the Stateflow Editor. A value of 1 corresponds to a zoom factor of 100%, 2 to a value of 200%, and so on. Default value = 1.

Editor Methods

The Editor object has the methods in the table below. For details on each method, see API Method Reference.

See also Editor Properties.

Method

Description

disp

Display the property names and their settings for this Editor object.

get

Return the specified property settings for the Editor object.

help

Display a list of properties for this Editor object with short descriptions.

methods

Display all nonglobal methods of this Editor object.

set

Set the specified property of this Editor object with the specified value.

struct

Return and display a MATLAB® structure containing the property settings of this Editor object.

zoomIn and zoomOut

Cause the Stateflow® chart to zoom in or zoom out in the Stateflow Editor.

Embedded MATLAB™ Function Properties

Stateflow® API objects for Embedded MATLAB™ functions have the properties shown below. See also Embedded MATLAB™ Function Methods.

Property

Type

Access

Description

ArrowSize

Double

RW

Size of transition arrows coming into the Embedded MATLAB function in the Stateflow chart (default = 8). Equivalent to selecting Arrowhead Size from the context menu for this function.

BadIntersection

Boolean

RO

If true, this Embedded MATLAB function graphically intersects a state, box, graphical function, truth table, or another Embedded MATLAB function.

Chart

Chart

RO

Chart object containing this Embedded MATLAB function.

Description

String

RW

Description of this Embedded MATLAB function (default = ''). Equivalent to entering a description in the Description field of the properties dialog for this Embedded MATLAB function.

Document

String

RW

Document link to this Embedded MATLAB function. Equivalent to entering the Document Link field of the properties dialog for this Embedded MATLAB function.

FontSize

Double

RW

Size of the (default = 12) font of the label text for this Embedded MATLAB function. This property overrides the font size set for this Embedded MATLAB function at creation by the StateFont.Size property of the containing Chart object. Equivalent to selecting Font Size > font size in the context menu for this Embedded MATLAB function.

Id

Integer

RO

Unique identifier assigned to this Embedded MATLAB function to distinguish it from other objects in the model.

LabelString

String

RW

Full label for this Embedded MATLAB function (default = '()') including its return, name, and arguments. Equivalent to typing the label for this Embedded MATLAB function in its label text field in the Stateflow Editor.

Machine

Machine

RO

Machine that contains this Embedded MATLAB function.

Name

String

RW

Name of this Embedded MATLAB function (default = ''). Equivalent to typing a name for this Embedded MATLAB function into the label text field of the truth table box in the Stateflow Editor. Label syntax is return = Name (arguments).

Position

Rect

RW

Position and size of this Embedded MATLAB function in the Stateflow chart, given in the form of a 1-by-4 array (default is [0 0 90 60]) consisting of the following:

  • (x,y) coordinates for the box's left upper vertex relative to the upper left vertex of the Stateflow Editor workspace

  • Width and height of the box

Script

String

RW

String that holds the lines of code in an Embedded MATLAB function. For example, you can use the property to define code in this way:

fcn = Stateflow.EMFunction(c);
str = sprintf('y=proc(x)\n y=x;');
fcn.script = str;

Subviewer

Chart or State

RO

State or chart in which you can graphically view this Embedded MATLAB function.

Tag

Any Type

RW

Holds data of any type (default = []) for this Embedded MATLAB function.

Embedded MATLAB™ Function Methods

Embedded MATLAB™ Function objects have the methods in the table below. For details on each method, see API Method Reference.

See also Embedded MATLAB™ Function Properties.

Method

Description

delete

Delete this Embedded MATLAB function from the Stateflow® chart.

dialog

Display the properties dialog of this Embedded MATLAB function.

disp

Display the property names and their settings for this Embedded MATLAB function object.

find

Find all objects that this Embedded MATLAB function contains that meet the specified criteria.

fitToView

Zoom in on this Embedded MATLAB function and highlight it in the Stateflow Editor.

get

Return the specified property settings for this Embedded MATLAB functions.

help

Display a list of properties for this Embedded MATLAB function with short descriptions.

methods

Display all nonglobal methods of this Embedded MATLAB object.

set

Set the specified property of this Embedded MATLAB object with the specified value.

struct

Return and display a MATLAB® structure containing the property settings of this Embedded MATLAB object.

view

Opens this Embedded MATLAB function in the Embedded MATLAB Editor.

Event Properties

Stateflow® API objects of type Event have the properties shown below. See also Event Methods.

Property

Type

Access

Description

Debug.
Breakpoints.
StartBroadcast

Boolean

RW

If set to true (default = false), set 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.

Debug.
Breakpoints.
EndBroadcast

Boolean

RW

If set to true (default = false), set 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.

Description

String

RW

Description of this event (default = ''). Equivalent to entering a description in the Description field in the Event properties dialog.

Document

String

RW

Document link to this event (default = ''). Equivalent to entering the Document Link field in the Event properties dialog.

Id

Integer

RO

Unique identifier assigned to this event to distinguish it from other objects in the model.

Machine

Machine

RO

Machine to which this event belongs.

Name

String

RW

Name of this event (default = eventn, where n is a counter of events with the name root event). Equivalent to entering the name in the Name field of the Event properties dialog.

Port

Integer

RO

Port index number for this event (default = 1).

Scope

Enum

RW

Scope of this event. Allowed values vary with the object containing this data.

The following applies to any event:

  • 'Local'

The following apply to events for charts only:

  • 'input' (Input from Simulink in properties dialog)

  • 'Output' (Output to Simulink in properties dialog)

The following apply to events for machines only:

  • 'Imported'

  • 'Exported'

Tag

Any Type

RW

Holds data of any type (default = []) for this event.

Trigger

Enum

RW

Type of signal that triggers this chart input event. Also the type of trigger associated with this chart output event. Equivalent to the entries for the Trigger field in the Event properties dialog.

The following triggers apply to both chart input and output events:

  • 'Either' (Either Edge)

  • 'Function call' (Function Call)

The following triggers apply only to chart input events:

  • 'Rising' (Rising Edge)

  • 'Falling' (Falling Edge)

Event Methods

Event objects have the methods in the table below. For details on each method, see API Method Reference.

See also Event Properties.

Method

Description

delete

Delete this event.

dialog

Display the Event properties dialog.

disp

Display the property names and their settings for this Event object.

get

Return the specified property settings for this event.

help

Display a list of properties for this Event object with short descriptions.

methods

Display all nonglobal methods of this Event object.

set

Set the specified property of this Event object with the specified value.

struct

Return and display a MATLAB® structure containing the property settings of this Event object.

view

Display this event in its properties dialog.

Graphical Function Properties

Stateflow® API objects of type Function have the properties shown below. See also Graphical Function Methods.

Property

Type

Access

Description

ArrowSize

Double

RW

Size of transition arrows coming into this graphical function (default = 8). Equivalent to selecting Arrowhead Size from the context menu for this function.

BadIntersection

Boolean

RO

If true, this function graphically intersects a state, box, Embedded MATLAB™ function, truth table, or another graphical function.

Chart

Chart

RO

Chart object containing this function.

Debug.
Breakpoints.
OnDuring

Boolean

RW

If true, sets the during breakpoint for this graphical function. Equivalent to selecting the Function Call check box in the properties dialog for this graphical function.

Description

String

RW

Description of this function (default = ''). Equivalent to entering a description in the Description field of the properties dialog for this graphical function.

Document

String

RW

Document link to this function. Equivalent to entering a link in the Document Link field of the properties dialog for this graphical function.

FontSize

Double

RW

Size of the (default = 12) font of the label text for this function. This property overrides the font size set for this function at creation by the StateFont.Size property of the containing Chart's object. Equivalent to selecting Font Size > <font size> in the context menu for this graphical function.

Id

Integer

RO

Unique identifier assigned to this function to distinguish it from other objects in the model.

InlineOption

Boolean

RW

Determine how generated code for this graphical function is implemented. Possible settings are as follows:

'Inline' — Call to function is replaced by code.

'Function' — Function becomes a C function.

'Auto' — Determines if the function is inlined or made a function through an internal calculation.

IsGrouped

Boolean

RW

If set to true (default = false), group this function.

IsSubchart

Boolean

RW

If set to true (default = false), make this function a subchart.

LabelString

String

RW

Label for this function (default = '()'). Equivalent to typing the label for this function in its label text field in the Stateflow Editor.

Machine

Machine

RO

Machine that contains this function.

Name

String

RW

Name of this function (default = ''). Equivalent to typing this function's name into the beginning of the label text field after the word 'function' in the Stateflow Editor.

Position

Rect

RW

Position and size of this function's box in the Stateflow chart, given in the form of a 1-by-4 array (default is [0 0 90 60]) consisting of the following:

  • (x,y) coordinates for the box's left upper vertex relative to the upper left vertex of the Stateflow Editor workspace

  • Width and height of the box

Subviewer

Chart or State

RO

State or chart in which this function can be graphically viewed.

Tag

Any Type

RW

Holds data of any type (default = []) for this function.

Graphical Function Methods

Function objects have the methods in the table below. For details on each method, see API Method Reference.

See also Graphical Function Properties.

Method

Description

defaultTransitions

Return the default transitions in this function at the top level of containment.

delete

Delete this function from the Stateflow® chart.

dialog

Display the properties dialog of this graphical function.

disp

Display the property names and their settings for this Function object.

find

Find all objects that this graphical function contains that meet the specified criteria.

fitToView

Zoom in on this graphical function and highlight it in the Stateflow Editor.

get

Return the specified property settings for this function.

help

Display a list of properties for this Function object with short descriptions.

methods

Display all nonglobal methods of this Function object.

set

Set the specified property of this Function object with the specified value.

sourcedTransitions

Return all inner and outer transitions whose source is this function.

struct

Return and display a MATLAB® structure containing the property settings of this Function object.

view

Display this function's chart in the Stateflow Editor with this state highlighted.

Junction Properties

Stateflow® API objects of type Junction have the properties shown below. See also Junction Methods.

Property

Type

Access

Description

ArrowSize

Double

RW

Size of transition arrows (default = 8) coming into this junction.

Chart

Chart

RO

Chart that this junction resides in.

Description

String

RW

Description of this junction (default = ''). Equivalent to entering a description in the Description field of the Junction properties dialog.

Document

String

RW

Document link to this junction (default = ''). Equivalent to entering the Document Link field of the Junction properties dialog.

Id

Integer

RO

Unique identifier assigned to this junction to distinguish it from other objects in the model.

Machine

Machine

RO

Machine containing this junction.

Position.
Center

Rect

RW

Position of the center of this junction (default = [10 10]) relative to the upper left corner of the parent chart or state as an [x,y] point array.

Position.
Radius

Rect

RO

Radius of this junction (default = 10).

Subviewer

Chart or State

RO

State or chart in which this junction can be graphically viewed.

Tag

Any Type

RW

Holds data of any type (default = []) for this junction.

Type

Enum

RO

Type of this junction. For junctions, can be 'CONNECTIVE' (default) or 'HISTORY'

Junction Methods

Junction objects have the methods in the table below. For details on each method, see API Method Reference.

See also Junction Properties.

Method

Description

delete

Delete this junction from the Stateflow® chart.

dialog

Display the Junction properties dialog.

disp

Display the property names and their settings for this Junction object.

fitToView

Zoom in on this junction and highlight it in the Stateflow Editor.

get

Return the specified property settings for this junction.

help

Display a list of properties for this Junction object with short descriptions.

methods

Display all nonglobal methods of this Junction object.

set

Set the specified property of this Junction object with the specified value.

sourcedTransitions

Return all inner and outer transitions whose source is this junction.

struct

Return and display a MATLAB® structure containing the property settings of this Junction object.

view

Display this junction's chart in the Stateflow Editor with this junction highlighted.

Machine Properties

Stateflow® API objects of type Machine have the properties shown below. See also Machine Methods.

Property

Type

Access

Description

Created

String

RO

Date of creation of this machine.

Creator

String

RW

Creator (default = 'Unknown') of this machine.

Debug.
Animation.
Enabled

Boolean

RW

If set to true (default), animation (simulation) is enabled. If false, disabled. Equivalent to the Enabled or Disabled radio button of the Animation section of the Debugger window.

Debug.
Animation.
Delay

Double

RW

Specify a value to delay (slow down) animation (default value = 0). Equivalent to the Delay (sec) field in the Animation section of the Debugger window.

Debug.
BreakOn.
ChartEntry

Boolean

RW

If set to true (default = false), set the chart entry breakpoint for all charts in this machine. Equivalent to the Chart Entry check box in the Debugger window.

Debug.
BreakOn.
EventBroadcast

Boolean

RW

If set to true (default = false), set the event broadcast breakpoint for all charts in this machine. Equivalent to the Event Broadcast check box in the Debugger window.

Debug.
BreakOn.
StateEntry

Boolean

RW

If set to true (default = false), set the state entry breakpoint for all charts in this machine. Equivalent to the State Entry check box in the Debugger window.

Debug.
DisableAllBreakpoints

Boolean

RW

If set to true (default = false), disable the use of all breakpoints in this machine. Equivalent to the Disable all check box in the Debugger window.

Debug.
RunTimeCheck.
CycleDetection

Boolean

RW

If set to true, check for cyclical behavior errors during a debug session. Equivalent to the Detect Cycles check box in the Debugger window.

Debug.
RunTimeCheck.
DataRangeChecks

Boolean

RW

If set to true (default), check for data range violations during a debug session. Equivalent to the Data Range check box in the Debugger window.

Debug.
RunTimeCheck.
StateInconsistencies

Boolean

RW

If set to true (default), check for state inconsistencies during a debug session. Equivalent to the State Inconsistency check box in the Debugger window.

Debug.
RunTimeCheck.
TransitionConflicts

Boolean

RW

If set to true (default), check for transition conflicts during a debug session. Equivalent to the Transition Conflict check box in the Debugger window.

Description

String

RW

Description of this state (default = ''). Equivalent to entering a description in the Description field of the properties dialog for this machine.

Dirty

Boolean

RW

If true (default), this model has changed since it was opened or saved.

Document

String

RW

Document link to this machine (default = ''). Equivalent to entering the Document Link field of the properties dialog for this machine.

EnableBitOps

Boolean

RW

If true, recognize C bitwise operators (~, &, |, ^, >>, and so on) in action language statements for all Stateflow charts in the model and encode them as C bitwise operations.

FullFileName

String

RO

Full path name of file (default value = '') under which this machine (model) is stored.

Iced

Boolean

RO

Equivalent to property Locked (default = false) except that this property is used internally to lock this model from being changed during activities such as simulation.

Id

Integer

RO

Unique identifier assigned to this machine to distinguish it from other objects loaded in memory.

isLibrary

Boolean

RO

If true (default = false), specifies that the current model builds a library and not an application.

Locked

Boolean

RW

If set to true (default = false), prevents user from changing any Stateflow chart in this model.

Machine

Machine

RO

A handle to the Machine object for this Machine object, that is, this Machine object.

Modified

String

RW

Comment area (default = '') for entering date and name of modification to this model.

Name

String

RO

Name of this model (default = 'untitled') set when saved to disk.

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 machine (default = []).

Version

String

RW

Comment string (default = 'none') for recording the version of this model.

Machine Methods

Machine objects have the methods in the table below. For details on each method, see API Method Reference.

See also Machine Properties.

Method

Description

dialog

Display the properties dialog of this machine.

disp

Display the property names and their settings for this Machine object.

find

Find all objects that this machine contains that meet the specified criteria.

    Note   Do not use the -depth switch with the find method for a machine object.

get

Return the specified property settings for this machine.

help

Display a list of properties for this Machine object with short descriptions.

methods

Display all nonglobal methods of this Machine object.

parse

Parse all the charts in this machine.

set

Set the specified property of this Machine object with the specified value.

struct

Return and display a MATLAB® structure containing the property settings of this Machine object.

Note Properties

Stateflow® API objects of type Note have the properties shown below. See also Note Methods.

Property

Type

Access

Description

Alignment

Enum

RW

Alignment of text in note box. Can be 'LEFT' (default), 'CENTER', or 'RIGHT'.

Chart

Chart

RO

Chart object containing this note.

Description

String

RW

Description of this note (default = ''). Equivalent to entering a description in the Description field of the Note properties dialog.

Document

String

RW

Document link to this note (default = ''). Equivalent to entering a link in the Document Link field of the Note properties dialog.

Font.
Name

String

RO

Name of the font (default = 'Helvetica') 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.
Angle

String

RW

Style of the font for the text in this note. Can be 'ITALIC' or 'NORMAL' (default). 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.
Size

Double

RW

Size of the font (default = 12) for the label text for this note. This property overrides the font size set for this note at creation by the StateFont.Size property of the containing Chart's object. Equivalent to selecting Font Size > <font size> in the context menu for this note.

Font.
Weight

String

RW

Weight of the font for the label text for this note. Can be 'BOLD' or 'NORMAL' (default). 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.

Id

Integer

RO

Unique identifier assigned to this note to distinguish it from other objects in the model.

Interpretation

Enum

RW

How the text in this note is interpreted for text processing. Can be 'NORMAL' (default) or