Products & Services Solutions Academia Support User Community Company

Learn more about Stateflow   

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
Simulink Function PropertiesDescriptions of properties for Simulink Function objects (Simulink functions) in the Stateflow API.
Simulink Function MethodsDescriptions of methods for Simulink Function objects (Simulink functions) in the Stateflow API.
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 box.

Document

String

RW

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

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 box.

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

Set the background color of your chart by using 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 box, 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 box.

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 a specific level of the chart hierarchy.

Description

String

RW

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

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 box.

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 box.

EnableNonTerminalStates

Boolean

RW

If set to true (default = false), enables super step semantics for the chart, as described in Execution of 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 color for errors in your chart by using a 1-by-3 RGB array (default = [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 box 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 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.

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.

InitializeOutput

Boolean

RWApplies the initial value of outputs every time a chart wakes up, not only at time 0. See Setting Properties for a Single Chart.

JunctionColor

[R,G,B]

RW

Set the color for junctions in your chart by using a 1-by-3 RGB array (default = [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 box 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 box.

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 Execution of 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 Execution of 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 box).

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 box 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 box 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 box 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 box 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 box 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 box 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 box 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 box.

SupportVariableSizing

Boolean

RW

If set to true (default), support chart input and output data that vary in dimension during simulation. Equivalent to selecting the Support variable-size arrays check box in the Chart properties dialog box.

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 color for transitions in your chart by using 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 box 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 box 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 box 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 box 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 box 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 box 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 box.

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 box.

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.SLFunction

Create a Simulink function for a parent chart or state.

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 box.

Description

String

RW

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

Document

String

RW

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

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 box.

  • 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 box.

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 box.

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 box.

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 box.

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 box.

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 box.

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 box.

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 box.

Props.
Type.
Fixpt.
Bias

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.
Type.
Fixpt.
FractionLength

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.
Type.
Fixpt.
Lock

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.
Type.
Fixpt.
ScalingMode

String

RW

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

  • None (the default)

  • Binary point

  • Slope and bias

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

Props.
Type.
Fixpt.
Slope

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.
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 box.

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 box.

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 box.

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 Save final value to base workspace check box in the Data properties dialog box.

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 box. 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 box.

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 box.

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 box.

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

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 box 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 box 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 box 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 box.

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 box.

Description

String

RW

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

Document

String

RW

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

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 box.

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

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

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 box.

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 box.

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 box.

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

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 box 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 box 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 box 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

String

RW

Determine how generated code for this graphical function appears. Possible settings are:

  • '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 box 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 box.

Document

String

RW

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

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 box.

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 box 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 box 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 box 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 box.

Document

String

RW

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

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 'TEX'.

Machine

Machine

RO

Machine that contains this note.

Position

Rect

RW

Position and size of this note's box in the Stateflow chart, given in the form of a 1-by-4 array (default is [0 0 25 25]) 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 note can be graphically viewed.

Tag

Any Type

RW

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

Text

String

RW

Label for this note (default = '?'). The text content for this note that you enter directly into the note in the Stateflow Editor or in the Label field of the Note properties dialog box.

Note Methods

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

See also Note Properties.

Method

Description

delete

Delete this note from the Stateflow chart.

dialog

Display the Note properties dialog box.

disp

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

fitToView

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

get

Return the specified property settings for this note.

help

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

methods

Display all nonglobal methods of this Note object.

set

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

struct

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

view

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

Root Methods

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

Method

Description

find

Find all objects that this Root object contains that meet the specified criteria.

get

Return the specified property settings for the Root object.

help

Display a list of properties for the Root object with short descriptions.

methods

Display all nonglobal methods of this Root object.

set

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

struct

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

Simulink Function Properties

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

Property

Type

Access

Description

ArrowSize

Double

RW

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

BadIntersection

Boolean

RO

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

Chart

Chart

RO

Chart object containing this function.

Description

String

RW

Description of this function (default = '').

Document

String

RW

Document link to this note.

FontSize

Double

RW

Size of the font (default = 12) 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 Simulink function.

Id

Integer

RO

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

LabelString

String

RW

Label for this function. 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 = 'simfcn'). Equivalent to typing the name of this function in its label text field in the Stateflow Editor.

Position

Rect

RW

Position and size of this function box in the Stateflow chart, given in the form of a 1-by-4 array (default is [0 0 90 60]) that consists 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

RO

Chart in which this function can be graphically viewed.

Tag

Any Type

RW

A field you can use to hold data of any type for this function.

Simulink Function Methods

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

See also Simulink Function Properties.

Method

Description

delete

Delete this function from the Stateflow chart.

disp

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

find

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

fitToView

Zoom in on this Simulink 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 Simulink Function object with short descriptions.

methods

Display all nonglobal methods of this Simulink Function object.

set

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

struct

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

view

Display the contents of the subsystem inside this Simulink function.

State Properties

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

Property

Type

Access

Description

ArrowSize

Double

RW

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

BadIntersection

Boolean

RO

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

Chart

Chart

RO

Chart object containing this state.

Debug.
Breakpoints.
OnDuring

Boolean

RW

If set to true (default = false), set the state during breakpoint for this chart. Equivalent to selecting the State During check box in the State properties dialog box.

Debug.
Breakpoints.
OnEntry

Boolean

RW

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

Debug.
Breakpoints.
OnExit

Boolean

RW

If set to true (default = false), set the state exit breakpoint for this chart. Equivalent to selecting the State Exit check box in the State properties dialog box.

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 state.

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

Description

String

RW

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

Document

String

RW

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

FontSize

Double

RW

Size of the font (default = 12) for the label text for this state. This property overrides the font size set for this state 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 state.

HasOutputData

Boolean

RW

If set to true (default = false), create a data output port on the Stateflow block for this state with its activity status. If the state is active, the output value is 1. If the state is inactive, the output is 0. Equivalent to selecting the Output State Activity check box in the State properties dialog box.

Id

Integer

RO

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

InlineOption

String

RW

Determine how generated code for this state appears. Possible settings are:

  • '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.

For guidelines on controlling inlining of state functions, see Controlling Inlining of State Functions in Generated Code in the Stateflow and Stateflow Coder User's Guide.

IsGrouped

Boolean

RW

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

Nothing can change inside a grouped state.

This property is also useful for copying states to a new location. See Copying by Grouping (Recommended).

IsSubchart

Boolean

RW

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

LabelString

String

RW

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

Machine

Machine

RO

Machine containing this state.

Name

String

RW

Name of this state (default = ''). Equivalent to typing this state's name into the beginning of the label text field for this state in the Stateflow Editor. Name is separated from the remainder of this state's label text by a forward slash (/) character.

Position

Rect

RW

Position and size of this state'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

Chart or state in which you can graphically view this state.

Tag

Any Type

RW

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

TestPoint

Integer

RW

If set to 1 (default = 0), sets this state as a Stateflow test point. See Monitoring Test Points in Stateflow Charts in the Stateflow and Stateflow Coder User's Guide.

Type

Enum

RO

Type of this state (default = 'OR'). Can be 'OR' (exclusive) or 'AND' (parallel). The type of this state is determined by the parent's Decomposition property.

State Methods

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

See also State Properties.

Method

Description

defaultTransitions

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

delete

Delete this state.

dialog

Display the State properties dialog box.

disp

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

find

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

fitToView

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

get

Return the specified property settings for this state.

help

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

innerTransitions

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

methods

Display all nonglobal methods of this State object.

outerTransitions

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

outputData

Output the activity status of this state to the Simulink base workspace via a data output port on the Stateflow block of this state.

set

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

sourcedTransitions

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

struct

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

view

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

Target Properties

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

Property

Type

Access

Description

ApplyToAllLibs

Boolean

RW

If set to true (default), 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 the code flag settings for this custom target. See CodeFlagsInfo Property of Targets for more information.

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 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 Target dialog box.

Description

String

RW

Description of this custom target (default = ''). Equivalent to entering a description in the Description field of the Custom Target dialog box.

Document

String

RW

Document link to this custom target (default = ''). Equivalent to entering the Document Link field of the Custom Target dialog box.

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 custom target.

Name

String

RW

Name of this custom target (default = 'untitled'). Equivalent to naming or renaming this target in the Model Explorer.

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 Target dialog box.

    Note   This property applies only to nonlibrary models. You cannot specify this property for library models.

Tag

Any Type

RW

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

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 Target dialog box.

    Note   If your list includes any Windows® path strings that contain spaces, each instance must be enclosed in double quotes within the argument string, for example,

    'C:\Project "C:\Custom Files"'

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 Target dialog box.

    Note   If your list includes any Windows file name strings that contain spaces, each instance must be enclosed in double quotes within the argument string, for example,

    'mathutil.lib "op utils.lib"'

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 Target dialog box.

    Note   If your list includes any Windows file name strings that contain spaces, each instance must be enclosed in double quotes within the argument string, for example,

    'algs.c "div alg.c"'

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 a custom 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 Custom Target dialog box. For example, the name 'comments' actually refers to the dialog box setting User 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. (See API Method Reference for more information.)

The names of possible code flags in the CodeFlagsInfo property and the name of the flag as it appears in the General pane of the Custom Target dialog box are as follows:

Name in CodeFlagsInfo

Name in Custom Target Dialog Box

Default Value

comments

User Comments in generated code

Enabled

autocomments

Auto-generated Comments in generated code

Disabled

emitdescriptions

State/Transition Descriptions in generated code

Enabled

statebitsets

Use bitsets for storing state configuration

Enabled

databitsets

Use bitsets for storing boolean data

Enabled

emitlogicalops

Compact nested if-else using logical AND/OR operators

Enabled

elseifdetection

Recognize if-elseif-else in nested if-else statements

Enabled

constantfolding

Replace constant expressions by a single constant

Enabled

redundantloadelimination

Minimize array reads using temporary variables

Disabled

exportcharts

Use chart names with no mangling

Disabled

ioformat

I/O data format:

Can be one of these values:

  • 0 = Use global input/output data

  • 1 = Pack input/output data into structures

0

initializer

Generate chart initializer function

Disabled

multiinstanced

Multi-instance capable code

Disabled

Target Methods

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

See also Target Properties.

Method

Description

build

Build this custom target incrementally only for those portions of the target's charts that have changed since the last build.

delete

Delete this custom target.

dialog

Display the Custom Target dialog box.

disp

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

get

Return the specified property settings for this custom target.

getCodeFlag

Return the value of the specified code flag for this custom target.

help

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

make

Compile this custom target incrementally only for those portions of generated code that have changed since the last compilation.

methods

Display all nonglobal methods of this Target object.

rebuildAll

Completely rebuild this custom target.

regenerateAll

Completely regenerate code for this custom target.

set

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

setCodeFlag

Set the specified code flag for this custom target with the specified value.

struct

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

view

Display this custom target in the Model Explorer.

Transition Properties

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

Property

Type

Access

Description

ArrowSize

Double

RW

Size of the arrow (default = 10) for this transition.

Chart

Chart

RO

Stateflow chart object containing this transition.

Debug.
Breakpoints.
WhenTested

Boolean

RW

If set to true (default = false), set a debugging breakpoint to occur when this transition is tested to see whether it is a valid transition or not. Equivalent to selecting the When Tested check box in the properties dialog box of this transition.

Debug.
Breakpoints.
WhenValid

Boolean

RW

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

Description

String

RW

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

Destination

State or Junction

RW

Destination state or junction (default = []) of this transition. Assign Destination the destination object for this transition.

You can also use the property Destination to detach the destination end of a transition, through the command t.Destination = [] where t is the Transition object.

DestinationOClock

Double

RW

Location of transition destination connection on state (default = 0). Varies from 0 to 12 for full clock cycle location. Its value is taken as modulus 12 of its assigned value.

Document

String

RW

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

DrawStyle

Enum

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.

    Note   Transition must be connected to effect a change in the DrawStyle property. Otherwise, an error occurs.

ExecutionOrder

Integer

RW

Specifies the number for this transition in the execution order for its source (see Evaluation Order for Outgoing Transitions in the Stateflow and Stateflow Coder User's Guide). The UserSpecifiedStateTransitionExecutionOrder property of the parent chart has to be set to true, otherwise, this transition property will be ignored. ExecutionOrder has to be an integer between 1 and m, where m is the total number of transitions originating from the source.

FontSize

Double

RW

Size of the font (default = 12) for the label text for this box. This property overrides the default size for this box, which is set by the TransitionFont.Size property of the Chart object containing this box. Equivalent to selecting Font Size > <font size> in the context menu for this box.

Id

Integer

RO

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

LabelPosition

Rect

RW

Position and size of this note's box in the Stateflow chart, given in the form of a 1-by-4 array (default is [0 0 8 14]) 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

LabelString

String

RW

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

Machine

Machine

RO

Machine containing this transition.

MidPoint

Rect

RW

Position of the midpoint of this transition relative to the upper left corner of the Stateflow Editor workspace in an [x y] point array (default = [0 0]).

Source

State or Junction

RW

Source state or junction of this transition (default = []). Assign Source the source object for this transition.

You can also use the property Source to detach the source end of a transition, through the command t.Source = [] where t is the Transition object.

SourceEndPoint

Rect

RO*

[x y] spatial coordinates for the endpoint of a transition (default = [2 2]). This property is RW (read/write) only for default transitions. For all other transitions it is RO (read-only).

SourceOClock

Double

RW

Location of transition source connection on state (default = 0). Varies from 0 to 12 for full clock cycle location. The value taken for this property is the modulus 12 of the entered value.

Subviewer

Chart or State

RO

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

Tag

Any Type

RW

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

Transition Methods

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

See also Transition Properties.

Method

Description

delete

Delete this transition from the Stateflow chart.

dialog

Display the properties dialog box of this transition.

disp

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

fitToView

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

get

Return the specified property settings for this transition.

help

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

methods

Display all nonglobal methods of this Transition object.

set

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

struct

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

view

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

Truth Table Properties

Stateflow API objects of type TruthTable have the properties shown below. See also Truth Table Methods.

Property

Type

Access

Description

ActionTable

Cell Array

RW

A cell array of strings containing the contents of the Action Table for this truth table.

ArrowSize

Double

RW

Size of transition arrows coming into the truth table function in the Stateflow chart (default = 8).

BadIntersection

Boolean

RO

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

Chart

Chart

RO

Chart object containing this truth table.

ConditionTable

Cell Array

RW

A cell array of strings containing the contents of the Condition Table for this truth table, including the Actions row.

Debug.
Breakpoints.
OnDuring

Boolean

RW

If true, sets the during breakpoint for this truth table. Equivalent to selecting the Function Call check box in the Truth Table properties dialog box.

Description

String

RW

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

Document

String

RW

Document link to this truth table. Equivalent to entering a link in the Document Link field of the Truth Table properties dialog box.

FontSize

Double

RW

Size of the (default = 12) font of the label text for this truth table. This property overrides the font size set for this truth table 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 truth table.

Id

Integer

RO

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

LabelString

String

RW

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

Machine

Machine

RO

Machine that contains this truth table.

Name

String

RW

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

OverSpecDiagnostic

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 Diagnostics menu item and then selecting one of the three values.

Position

Rect

RW

Position and size of this truth table'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 truth table can be graphically viewed.

Tag

Any Type

RW

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

UnderSpecDiagnostic

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 Diagnostics menu item and then selecting one of the three values.

Truth Table Methods

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

See also Truth Table Properties.

Method

Description

delete

Delete this truth table from the Stateflow chart.

dialog

Display the Truth Table properties dialog box.

disp

Display the property names and their settings for this truth table object.

find

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

fitToView

Zoom in on this truth table and highlight it in the Stateflow Editor.

get

Return the specified property settings for this truth table.

help

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

methods

Display all nonglobal methods of this truth table object.

set

Set the specified property of this truth table object with the specified value.

struct

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

view

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

Truth Table Chart Properties

Stateflow API objects of type TruthTableChart have the properties shown below. See also Truth Table Chart Methods.

Property

Type

Access

Description

ActionTable

Cell Array

RW

A cell array of strings containing the contents of the Action Table for this truth table block.

ChartUpdateEnumRWActivation method of this chart. Can be 'INHERITED' (default), 'DISCRETE', or 'CONTINUOUS'.

ConditionTable

Cell Array

RW

A cell array of strings containing the contents of the Condition Table for this truth table block, including the Actions row.

Description

String

RW

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

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

Document

String

RW

Document link to this truth table block.

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

Id

Integer

RO

Unique identifier assigned to this truth table block to distinguish it from other objects in the model.

InputFimathembedded.fimath objectRWThe embedded.fimath object that will be associated with inputs from Simulink blocks.

LabelString

String

RW

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

LockedBooleanRWIf set to true (default = false), mark this block as read-only and prohibit any write operations on it.

Machine

Machine

RO

Machine that contains this truth table block.

Name

String

RW

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

OverSpecDiagnostic

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.

Path

String

RW

Path to the block.

SampleTimeStringRWSample time for activating this chart (default = ' ').

Tag

Any Type

RW

Holds data of any type (default = []) for this truth table block.

TreatInheritedIntegersAsStringRWDetermines how inherited integer signals are treated in Embedded MATLAB functions.

The two choices are Integers and Fixed-point. A Simulink model does not distinguish between a fixed-point signal with zero fraction length and an integer signal. However, the MATLAB workspace has two different classes for these two kinds of data: Integers (uint8, int16, etc...) and embedded.fi.

You can specify the type for any given input signal to be either Integer or fixed-point and override this default.

UnderSpecDiagnostic

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.

Truth Table Chart Methods

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

See also Truth Table Chart Properties.

Method

Description

defaultTransitions

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

delete

Delete this truth table from the Stateflow chart.

dialog

Display the properties dialog box of this truth table.

disp

Display the property names and their settings for this truth table object.

find

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

get

Return the specified property settings for this truth table.

help

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

methods

Display all nonglobal methods of this truth table object.

set

Set the specified property of this truth table object with the specified value.

struct

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

view

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

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS