Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

ssSetRWorkValue

Set an element of a block's floating-point work vector

Syntax

real_T ssSetRWorkValue(SimStruct *S, int_T idx, real_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 real_T value passed into the macro.

Description

Sets the idx element of the S-function's floating-point work vector to value. The vector consists of elements of type real_T and is of length ssGetNumRWork(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

ssSetRWorkValue(S, 0, 1.0);

sets the first element of the work vector to 1.0.

Introduced before R2006a

Was this topic helpful?