| Using Simulink | ![]() |
Calling Subfunctions in Embedded MATLAB Functions
If you call a function in an Embedded MATLAB function, Simulink first tries to resolve it as a subfunction of the Embedded MATLAB function. Subfunctions are functions defined in the body of the Embedded MATLAB function. They work the same way in Embedded MATLAB functions that they do in MATLAB.
In the section Programming the Embedded MATLAB Function, you define an Embedded MATLAB Function block with the subfunction avg as shown.
You can include subfunctions for Embedded MATLAB functions just as you would for ordinary MATLAB M-file functions. Subfunctions also can have multiple arguments and returns using any Embedded MATLAB function variable types and sizes. See Subfunctions in the MATLAB Programming documentation for a full description of subfunctions in MATLAB.
| Functions in Embedded MATLAB Functions | Calling Embedded MATLAB Run-Time Library Functions | ![]() |
© 1994-2005 The MathWorks, Inc.