| Contents | Index |
void *ssSetPWorkValue(SimStruct *S, int_T idx, void *pointer)
SimStruct representing an S-Function block.
Index of the element to be set.
New pointer element.
The pointer passed into the macro.
Sets the idx element of the S-function'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.
C, C++
The following statement
typedef struct Color_tag {int r; int b; int g;} Color;
Color *p = malloc(sizeof(Color));
ssSetPWorkValue(S, 0, p);
sets the first element of the pointer work vector to a pointer to the allocated Color structure.
ssGetNumPWork, ssGetPWork, ssGetPWorkValue

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |