Main Content

ssGetBusElementNumDimensions

Get the number of dimensions for a bus element

Syntax

int_T ssGetBusElementNumDimensions(SimStruct* S, int_T busTypeID, int_T elemIdx)

Arguments

S

SimStruct that represents an S-Function block

busTypeID

The bus data type identifier that represents the bus signal

elemIdx

The zero-based bus element index

Returns

int_T

Description

Get the number of dimensions for the bus element that you specify. Use the returned value to loop over each dimension in the dimensions array thatssGetBusElementDimensionsreturns.

语言

C, C++

Example

static void mdlOutputs(SimStruct *S, int_T tid) { DTypeId dType = ssGetOutputPortDataType(S, 0); const void *u = ssGetInputPortSignal(S, 0); int numElems = ssGetNumBusElements(S, dType); int i; for(i=0; i
             

Version History

Introduced in R2010a