| Contents | Index |
real_T *ssGetDiscStates(SimStruct *S)
A pointer (real_T *) to the discrete state vector as an array of length ssGetNumDiscStates(S). Returns NULL if the S-function does not have any discrete states.
Use to obtain the block's discrete states. Typically, the state vector is initialized in mdlInitializeConditions, updated in mdlUpdate, and used in mdlOutputs. You can use this macro in the simulation loop, mdlInitializeConditions, or mdlStart routines.
C, C++
See the S-function dsfunc.c used in sfcndemo_dsfunc.mdl for an example on how to initialize and update the discrete state vector.
ssGetNumDiscStates, ssGetRealDiscStates, mdlInitializeConditions, mdlUpdate, mdlOutputs, mdlStart

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 |