Reusable Functions in Charts

Write function calls that simplify state actions and transition conditions.

With reusable functions in Stateflow®, you can quickly and efficiently create charts by reusing common syntactical structures. Reuse these algorithms either within your Stateflow chart or in your Simulink® model.

  • Flow Chart Algorithm
    Encapsulate flow charts containing if-then-else, switch-case, for, while, or do-while patterns
  • MATLAB Algorithm
    Write matrix-oriented algorithms, call MATLAB® functions for data analysis and visualization.
  • Truth Table Algorithm
    Represent combinational logic for decision-making applications such as fault detection and mode switching.
  • Simulink Algorithm
    Call Simulink function-call subsystems directly to streamline design and improve readability.
  • Custom Code Algorithm
    Include custom C code for simulation and code generation.
Was this topic helpful?