Main Content

ssGetBusElementComplexSignal

Get the signal complexity for a bus element

Syntax

CSignal_T ssGetBusElementComplexSignal(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

CSignal_T

Description

Use to get the complexity of the bus element that you specify. The signal can be real or complex.

Languages

C, C++

Examples

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<numElems; i++) {
        CSignal_T sigType = ssGetBusElementComplexSignal(S, dType, i);
 
        if (sigType == COMPLEX_YES) {
            ...
        } else {
            ...
        }
      }
    }

Version History

Introduced in R2010a