Stateflow User's Guide Previous page   Next Page

Defining Function Data

Before you can finish a function, you need to define all or some of its data. Use the following steps to defined data for a Stateflow function:

  1. Specify the data properties (data type, initial value, and so on) for the function arguments and return value.
  1. The following restrictions apply to setting properties for the arguments and return value of a function:

  1. Create any additional data items that the function might need to process its programming when it is called.
  1. A function can access its own data or data belonging to parent states or the chart. The items that you create for the function itself can have any of the following scopes:

It is not necessary to assign local data to an embedded MATLAB function. You can declare local data in an embedded MATLAB function simply by using it. In this case, Stateflow uses first use assignments to determine the type, size, and value of the local data. See Declaring Variables Implicitly in Simulink documentation for specific rules in declaring local data in Embedded MATLAB functions.


Previous page  Programming Functions Calling Functions in Stateflow Next page

© 1994-2005 The MathWorks, Inc.