Writing S-Functions Previous page   Next Page
ssSetPWorkValue

Set an element of a block's pointer work vector

Syntax

Arguments

S
   SimStruct representing an S-Function block.

idx
   Index of the element to be set.

pointer
   New pointer element.

Description

Sets the idx element of S's pointer work vector to pointer. The vector consists of elements of type void* and is of length ssGetNumPWork(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 pointer that it sets.

Example

The following statement

sets the first element of the pointer work vector to a pointer to the allocated Color structure.

Languages

C

See Also

ssGetNumPWork, ssGetPWork, ssGetPWorkValue


Previous page  ssSetPlacementGroup ssSetRWorkValue Next page

© 1994-2005 The MathWorks, Inc.