Stateflow User's Guide Previous page   Next Page

Using Embedded MATLAB Functions


An Embedded MATLAB function lets you compose a MATLAB language function in Stateflow. In a Stateflow Embedded MATLAB function, you create functions with a rich subset of the MATLAB language that generates efficient C code meeting the strict memory and data type requirements of embedded target environments. In this way, Embedded MATLAB functions bring the power of MATLAB into Stateflow diagrams.
To learn how to use an Embedded MATLAB function in a Stateflow diagram, see the following sections:
Introduction to Embedded MATLAB Functions
Introduction to Embedded MATLAB functions through an example that shows you how to use them in Stateflow
Building a Simulink Model with a Stateflow Embedded MATLAB Function
Procedure building a Simulink model with a Stateflow diagram that calls an Embedded MATLAB function
Programming a Stateflow Embedded MATLAB Function
Procedure for programming an example Embedded MATLAB function that gives you an overview of program syntax, local data, and callable functions
Debugging a Stateflow Embedded MATLAB Function
Procedure for debugging an example Embedded MATLAB function with its own debugging tools


Previous page  How Stateflow Generates Graphical Functions for Truth Tables Introduction to Embedded MATLAB Functions Next page

© 1994-2005 The MathWorks, Inc.