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.

ssSetNumPWork

Specify the size of a block's pointer work vector

Syntax

int_T ssSetNumPWork(SimStruct *S, int_T nPWork)

Arguments

S

SimStruct representing an S-Function block.

nPWork

Number of elements to be allocated to the pointer work vector of the block represented by S.

Returns

The number of elements specified by nPWork, or -1 if DYNAMICALLY_SIZED.

Description

Use in mdlInitializeSizes to specify the number of pointer (void *) work vector elements as 0, a positive integer, or DYNAMICALLY_SIZED. If you specify DYNAMICALLY_SIZED, you can specify the true (positive integer) width in mdlSetWorkWidths; otherwise, the width used is the width of the signal passing through the block. The elements of the pointer vector are initialized to NULL until values are assigned using ssSetPWorkValue or via the pointer obtained fromssGetPWork.

Languages

C, C++

Example

See the S-function sfun_rtwdwork.c used in sfcndemo_sfun_rtwdwork.

Introduced before R2006a

Was this topic helpful?