Upcoming Program

MATLAB & Simulink


Stateflow for Logic Driven System Modeling

Course Highlight

This two-day course shows how to implement complex decision flows and finite-state machines using Stateflow®. The course focuses on how to employ flow charts, state machines, and truth tables, and state transition tables in Simulink designs. Topics include:

  • Flow graphs

  • State machines

  • Hierarchical state machines

  • Parallel state charts

  • Events in state charts

  • Functions in state charts

  • Truth tables

  • State transition tables

  • Design considerations


Techsource Systems is
Mathworks Sole and Authorised Distributor and Training Partner

Attended Comprehensive MATLAB and Comprehensive SIMULINK course or equivalent experience in using MATLAB and SIMULINK. Knowledge of C programming is helpful.

Course Outline

Day 1 of 2

Modeling Flow Graphs


Objective: Implement decision flows with flow graphs.

  • Junctions and transitions

  • Flow chart behavior

  • Stateflow interface

  • Conditions and condition actions

  • Chart data

  • Common patterns


Modeling State Machines


Objective: Implement state machines with state transition diagrams.

  • State machine behavior

  • State and transition actions

  • Chart initialization

  • Action execution order

  • Flow charts within states


Hierarchical State Diagrams


Objective: Implement hierarchical diagrams to improve the clarity of state machine designs.

  • Superstates and substates

  • State data

  • History junction

  • Transition priority

  • Action execution order


Parallel State Diagrams


Objective: Implement parallel states to model multiprocessing designs.

  • Benefits of parallel states

  • Chart/state decomposition

  • Parallel state behavior

Day 2 of 2

Using Events in State Diagrams


Objective: Use events within a Stateflow diagram to affect chart execution.

  • Using events in state diagrams

  • Broadcasting events

  • Behavior of state diagrams that contain events

  • Implicit events

  • Temporal logic operators


Calling Functions from Stateflow


Objective: Create functions in a Stateflow chart out of Simulink blocks, MATLAB code, and flow charts.

  • Types of functions 

  • Simulink functions

  • MATLAB functions

  • Graphical functions


Truth Tables and State Transition Tables


Objective: Create flow charts and state transition diagrams in tabular form.

  • Truth tables

  • Conditions, decisions, and actions

  • State transition tables

  • States, transitions, and actions


Design Considerations in Stateflow


Objective: Reuse Stateflow designs, constrain chart semantics, and interact with structured Simulink data.

  • Mealy and Moore charts

  • Data types

  • Bus signals

  • Atomic subcharts

  • Data mapping

  • Chart reuse