This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Scheduling Simulink® Algorithms Using Stateflow®

This model shows how you can schedule a Simulink algorithm using Stateflow.

The Stateflow chart Chart consists of a Simulink algorithm which needs to run at different rates at different times in the simulation. Stateflow is ideally suited to designing the transition logic which determines when these rate transitions happen. The Simulink algorithm on the other hand is used for the actual data processing. Note that we are merely passing in chart inputs and outputs to the Simulink subsystem. For the purposes of this example, the Simulink algorithm merely adds the input to the output each time it is called.

Upon running the simulation, we see the counter counting at varying rates as shown below:

Was this topic helpful?