User`s guide

The C MEX S-Function SimStruct
3-113
ssSetNumPWork(S,nPWork)
Used in mdlInitializeSizes to specify the number of pointer
(
void *) work v ector elements as 0, a positive integer, or
DYNAMICALLY_SIZED. If you specify DYNAMICALLY_SIZED,then
you can optionally specify the true (positive integer) width in
mdlSetWorkWidths, otherwise the width to be used will be the
width of the signal passing through the block.
ssSetNumNonsampledZCs
(S,nNonsampledZCs)
Used in mdlInitializeSizes to specify the number of
nonsampled zero crossings (
real_T)as0,apositiveinteger,or
DYNAMICALLY_SIZED. If you specify DYNAMICALLY_SIZED,then
you can optionally specify the true (positive integer) width in
mdlSetWorkWidths, otherwise the width to be used will be the
width of the signal passing through the block.
ssSetNumModes(S,nModes)
Used in mdlInitializeSizes to specify the number of modes
(int_T’s which are typically used with nonsampled zero
crossings) as 0, a positive integer,or
DYNAMICALLY_SIZED.Ifyou
specify
DYNAMICALLY_SIZED, then you can optionally specify the
true (positive integer) width in
mdlSetWorkWidths,otherwise
the width to be used will be the width of the signal passing
through the block.
ssGetNumContStates(S)
Canbeusedinanyroutine(exceptmdlInitializeSizes)to
determine the number of continuous states your S-function is
using.
ssGetContStates(S)
Can be used in the simulation loop, mdlInitializeConditions,
or
mdlStart routines t o get the real_T continuous state vector.
This vector has l ength
ssGetNumContStates(S). Typically, this
vector is initialized in
mdlInitializeConditions andusedin
mdlOutputs.
ssGetdX(S)
This is used in mdlDerivatives to return the derivatives for
your continuous states. This vector has length
ssGetNumContStates(S).
Table 3-10: State and Work Vector SimStruct Macros (Continued)
Macro Description