Products & Services Solutions Academia Support User Community Company

Learn more about Stateflow   

Graphical Functions

What Is a Graphical Function?

A graphical function is a function defined graphically by a flow graph that includes Stateflow action language.

Example of Using a Graphical Function

This figure shows a graphical function side by side in a Stateflow chart with the transition that calls it:

In this example, the function z = f(x,y) is called in the condition action of the transition from state A to state B. The function is defined using symbols that are valid only within the function itself. The function is called using data objects available to states A and B and their parent states (if any).

Advantages of Using Graphical Functions

Graphical functions are similar to textual functions such as C and MATLAB functions in these ways:

Unlike C and MATLAB functions, however, graphical functions are native Stateflow graphical objects. You use the Stateflow Editor to create them, and they reside in your Stateflow chart. This property makes graphical functions easier to create, access, and manage than textual custom code functions, whose creation requires external tools, and whose definition resides separately from the chart.

For more information, see Using Graphical Functions to Extend Actions.

  


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