Skip to Main Content Skip to Search
Product Documentation

ssSetDWorkUsedAsDState - Specify that a data type work vector is used as a discrete state vector

Syntax

int_T ssSetDWorkUsedAsDState(SimStruct *S, int_T vector,
  int_T usage)

Arguments

S

SimStruct representing an S-Function block.

vector

Index of a data type work vector, where the index is one of 0, 1, 2, ... ssGetNumDWork(S)-1.

usage

How this vector is used. A value of 1 indicates that the work vector is to be used to store the block's discrete states (SS_DWORK_USED_AS_DSTATE), a value of 0 indicates that the work vector is to be used as a work vector (SS_DWORK_USED_AS_DWORK).

Returns

0 if usage is SS_DWORK_USED_AS_DWORK (0), otherwise returns 1.

Description

Use in mdlInitializeSizes or mdlSetWorkWidths to specify if the DWork vector vector is used to store the block's discrete states, SS_DWORK_USED_AS_DSTATE (1), or not, SS_DWORK_USED_AS_DWORK (0), the default.

Languages

C, C++

Examples

For more information on using DWork vectors, see Using Work Vectors.

See Also

ssGetDWorkUsedAsDState

  


Related Products & Applications

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