Examples


Use this list to find examples in the documentation.

Stateflow Chart Objects

Stateflow® Chart Objects
States
Transitions
Default Transitions
Conditions
History Junction
Actions
Connective Junctions

Stateflow Hierarchy

Stateflow® Hierarchy of Objects
Representing State Hierarchy Example
Transition Hierarchy

Exploring a Real-World Stateflow Chart Application

Overview of the "fuel rate controller" Model
Control Logic of the "fuel rate controller" Model
Simulating the "fuel rate controller" Model
Using Clear Control Logic

Active and Inactive States

Exclusive (OR) State Decomposition
Parallel (AND) State Decomposition

Label Notation

Transition Label Example

Transition Connections

Transitions to and from Exclusive (OR) States
Transitions to and from Junctions
Transitions to and from Exclusive (OR) Superstates
Transitions to and from Substates
Self-Loop Transitions

Inner Transitions

Before Using an Inner Transition
After Using an Inner Transition to a Connective Junction
Using an Inner Transition to a History Junction
Processing One Event in an Exclusive (OR) State
Processing a Second Event in an Exclusive (OR) State
Processing a Third Event in an Exclusive (OR) State
Processing the First Event with an Inner Transition to a Connective Junction
Processing a Second Event with an Inner Transition to a Connective Junction
Inner Transition to a History Junction Example

Default Transitions

Default Transition to a Junction Example
Default Transition with a Label Example
Default Transition in Exclusive (OR) Decomposition Example
Default Transition to a Junction Example
Default Transition and a History Junction Example
Labeled Default Transitions Example

Connective Junctions

Connective Junction with All Conditions Specified Example
Connective Junction with One Unconditional Transition Example
Connective Junction — Self-Loop Example
Connective Junction and For Loops Example
Flow Graph Notation Example
Connective Junction from a Common Source to Multiple Destinations Example
Connective Junction Common Events Example
Label Format for Transition Segments Example
If-Then-Else Decision Construct Example
Self-Loop Transition Example
For-Loop Construct Example
Flow Graph Notation Example
Transitions from a Common Source to Multiple Destinations Example
Transitions from Multiple Sources to a Common Destination Example
Transitions from a Source to a Destination Based on a Common Event Example
Backtracking Behavior in Flow Graphs Example

History Junctions

Use of History Junctions Example

Graphical Functions

Graphical Functions
Creating a Graphical Function
Calling Graphical Functions in Stateflow® Action Language

Boxes

Boxes

Early Return Logic for Event Broadcasts

Early Return Logic for Event Broadcasts

Transitions to and from Exclusive (OR) States

Transitioning from State to State with Events Example
Transitioning from a Substate to a Substate with Events Example

Condition Actions

Condition Action Example
Condition and Transition Actions Example
Condition Actions in For-Loop Construct Example
Condition Actions to Broadcast Events to Parallel (AND) States Example
Cyclic Behavior to Avoid with Condition Actions Example

Event Actions

Event Actions in a Superstate Example

Parallel (AND) States

Event Broadcast State Action Example
Event Broadcast Transition Action with a Nested Event Broadcast Example
Event Broadcast Condition Action Example

Directed Event Broadcasting

Directed Event Broadcast Using Send Example
Directed Event Broadcasting Using Qualified Event Names Example

Charts

Creating a Stateflow® Chart

Self-Loop Transitions

Creating Self-Loop Transitions

Stateflow Editor Window

Stateflow® Editor Window

Supertransition

What Is a Supertransition?
Drawing a Supertransition Into a Subchart
Drawing a Supertransition Out of a Subchart

Smart and Nonsmart Transitions

Smart Transitions Slide Around Surfaces
Smart Transitions Slide and Maintain Shape
Smart Transitions Connect States to Junctions at 90 Degree Angles
Smart Transitions Snap to an Invisible Grid
Smart Transitions Bow Symmetrically
Nonsmart Transitions Anchor Connection Points
Nonsmart Transitions Distort Asymmetrically

Note Font and Color

TeX Instructions

Data and Events

Sharing Input and Output Data with Simulink® Models
Using Data and Event Arguments in Actions
Array Notation
Event Broadcast State Action Example
Event Broadcast Transition Action Example
Directed Event Broadcasting Using send
Directed Event Broadcasting Using Qualified Event Names
Symbol Autocreation Wizard

Action Language

State Action Types

Custom C Code Functions

Function Call Transition Action Example
Function Call State Action Example

MATLAB Functions and Variables

ml Namespace Operator
ml Function
ml Expressions
Which ml Should I Use?
ml Data Type
Inferring Return Size for ml Expressions

Temporal Logic Operators

Rules for Using Temporal Logic Operators
Operators for Event-Based Temporal Logic

Fixed-Point Data

Fixed-Point "Bang-Bang Control" Example
:= Multiplication Example
:= Division Example
Offline and Online Conversion Examples

Complex Data

Implementing a Frame Synchronization Controller Using a Stateflow® Chart

Interfaces with Simulink Models

Triggered Stateflow® Block Example
Sampled Stateflow® Block Example
Inherited Stateflow® Block Example
Function-Call Output Events Example
Function-Call Semantics Example
Edge-Triggered Semantics Example
Exported Data Example
Imported Data Example
Exported Event Example
Imported Event Example

Parsing Stateflow Charts

Parsing Chart Example

Debugging

Debugging Run-Time Errors Example
State Inconsistency Example
Conflicting Transition Example
Data Range Violation Example
Cyclic Behavior Example
Flow Cyclic Behavior Not Detected Example
Noncyclic Behavior Flagged as a Cyclic Example

Model Coverage

Superstate Containing Exclusive OR Substates Decision
Condition Coverage
MCDC Coverage
Summary Report Section
Chart as Subsystem Details Report Section
Chart as Superstate Details Report Section
State Details Report Section
Transition Details Report Section

Search and Replace

Searching with Regular Expression Tokens
Replacing with Case Preservation
Replacing with Tokens

Stateflow Finder

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