| Contents | Index |
A Simulink function can reside anywhere in a chart, state, or subchart. The location of a function determines its scope, that is, the set of states and transitions that can call the function. Follow these guidelines:
If you want to call the function only within one state or subchart and its substates, put your Simulink function in that state or subchart. That function overrides any other functions of the same name in the parents and ancestors of that state or subchart.
If you want to call the function anywhere in that chart, put your Simulink function at the chart level.
![]() | Why Use a Simulink Function in a Stateflow Chart? | How to Define a Simulink Function in a Stateflow Chart | ![]() |

Learn how engineers use Stateflow to model state machines in their Simulink models.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |