Documentation Center

  • Trial Software
  • Product Updates

Contents

ssSetIWorkValue

Set an element of a block's integer work vector

Syntax

int_T ssSetIWorkValue(SimStruct *S, int_T idx, int_T value)

Arguments

S

SimStruct representing an S-Function block.

idx

Index of the element to be set.

value

New value of element.

Returns

The int_T value passed into the macro.

Description

Sets the idx element of the S-function'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.

Languages

C, C++

Example

The following statement

ssSetIWorkValue(S, 0, 1);

sets the first element of the work vector to 1.

Was this topic helpful?