Main Content

ssSetNumDiscStates

Specify the number of discrete states that a block has

Syntax

void ssSetNumDiscStates(SimStruct *S, int_T nDiscStates)

Arguments

S

SimStruct representing an S-Function block.

nDiscStates

Number of discrete states to be set for the block represented byS.

Description

Use inmdlInitializeSizesto specify the number of discrete states as 0, a positive integer, orDYNAMICALLY_SIZED. If you specifyDYNAMICALLY_SIZED, you can specify the true (positive integer) width inmdlSetWorkWidths; 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) inmdlUpdate. Discrete states are logged if theStatesoption is selected on theData Import/Exportpage of the Configuration Parameters dialog box.

拉nguages

C, C++

Example

See the S-functiondsfunc.cused insfcndemo_dsfunc.

Version History

Introduced before R2006a