Writing S-Functions    
ssSetIWorkValue

Set an element of a block's integer work vector.

Syntax

Arguments

S
   SimStruct representing an S-Function block.

idx
   Index of the element to be set

value
   New value of element

Description

Sets the idx element of S's integer work vector to value. The vector consists of elements of type int_T and is of length ssGetNumIWork(S). Typically, this vector is initialized in mdlStart or mdlInitializeConditions, updated in mdlUpdate, and used in mdlOutputs. You can use this macro in the simulation loop, mdlInitializeConditions, or mdlStart routines. This macro returns the value that it sets.

Example

The following statement

sets the first element of the work vector to 1.

Languages

C

See Also
ssGetNumIWork, ssGetIWork, ssGetIWorkValue


  ssSetInputPortWidth ssSetModeVectorValue