| Contents | Index |
No
#define MDL_START
void mdlStart(SimStruct *S)
Start(s)
Instance of Simulink.MSFcnRunTimeBlock class representing the Level-2 MATLAB S-Function block.
The Simulink engine invokes this optional method at the beginning of a simulation. The method performs initialization activities that this S-function requires only once, such as allocating memory, setting up user data, or initializing states.
If your S-function resides in an enabled subsystem and needs to reinitialize its states every whenever the subsystem is enabled, use mdlInitializeConditions to initialize the state values, instead of mdlStart.
In C MEX S-functions, use ssGetContStates and/or ssGetDiscStates to get the states.
C, C++, MATLAB
See sfun_directlook.c for an example of how to use this function.
See msfcn_varpulse.m for an example of how to use this function.
mdlInitializeConditions, ssGetContStates, ssGetDiscStates

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |