User`s guide
3 Writing S-Functions As C-MEX files
3-114
ssGetNumDiscStates(S)
Canbeusedinanyroutine(exceptmdlInitializeSizes)to
determine the number of discrete states your S-function i s
using.
ssGetRealDiscStates(S)
Canbeusedinthesimulationloop,mdlInitializeConditions,
or
mdlStart routines to get the real_T discrete state vector.
This vector has length
ssGetNumDiscStates(S). Typically, this
vector is initialized in
mdlInitializeConditions, updated in
mdlUpdate, and used in mdlOutputs.
ssGetNumRWork(S)
Canbeusedinanyroutine(exceptmdlInitializeSizes)to
determine the number of real work vector elements your
S-function is using.
ssGetRWork(S)
Canbeusedinthesimulationloop,mdlInitializeConditions,
or
mdlStart routines to get the real_T work vector. This vector
has length
ssGetNumRWork(S). Typically, this vector is
initialized in
mdlStart or mdlInitializeConditions, updated
in
mdlUpdate, and used in mdlOutputs.
ssGetNumIWork(S)
Canbeusedinanyroutine(exceptmdlInitializeSizes)to
determine the number of integer work vector elements your
S-function is using.
ssGetIWork(S)
Canbeusedinthesimulationloop,mdlInitializeConditions,
or
mdlStart routines to get the int_T work vector. This vector
has length
ssGetNumIWork(S). Typically, this vector is
initialized in
mdlStart or mdlInitializeConditions, updated
in
mdlUpdate, and used in mdlOutputs.
ssGetNumPWork(S)
Canbeusedinanyroutine(exceptmdlInitializeSizes)to
determine the number of pointer work vector elements your
S-function is using.
Table 3-10: State and Work Vector SimStruct Macros (Continued)
Macro Description