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 this 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:

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS