Writing S-Functions | ![]() ![]() |
Specify the number of discrete states that a block has.
Syntax
ssSetNumDiscStates(SimStruct *S, int_T nDiscStates)
Arguments
S
SimStruct representing an S-function block.
S
.
Description
Use in mdlInitializeSizes
to specify the number of discrete states as 0, a positive integer, or DYNAMICALLY_SIZED
. If you specify DYNAMICALLY_SIZED
, you can specify the true (positive integer) width in mdlSetWorkWidths
, otherwise the width used is the width of the signal passing through the block. If your S-function has discrete states, it should return the next discrete state (in place) in mdlUpdate
. Discrete states are logged if the States is checked on the Workspace I/O page of the Simulation Parameters dialog box.
Languages
See Also
ssSetNumContStates, ssGetNumDiscStates
![]() | ssSetNumContStates | ssSetNumDWork | ![]() |