Products & Services Industries Academia Support User Community Company

Learn more about Stateflow   

Introduction to Embedded MATLAB Functions

You can use Embedded MATLAB functions to add MATLAB functions to a Stateflow chart. This capability is useful for coding algorithms that are better expressed in the textual MATLAB language than in the graphical Stateflow action language. Embedded MATLAB functions work with a subset of the MATLAB language called the Embedded MATLAB subset, which provides optimizations for generating efficient, production-quality C code for embedded applications. For more information, see Working with the Embedded MATLAB Subset.

This example shows a Simulink model with a Stateflow chart that contains an Embedded MATLAB function.

You will build a similar model in Building a Simulink Model with an Embedded MATLAB Function.

Note in this example that the Embedded MATLAB function can call any of these types of functions:

  


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