Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

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 by 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 option is selected on the Data Import/Export page of the Configuration Parameters dialog box.

Languages

C, C++

Example

See the S-function matlabroot/toolbox/simulink/simdemos/simfeatures/src/dsfunc.c used in sfcndemo_dsfunc.mdl.

See Also

ssSetNumContStates, ssGetNumDiscStates

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS