Main Content

Access Property-Specific C API Arrays

Property-specific maps are structure arrays and primitive-type arrays dedicated each to catalog and store information about a generic property, unrelated to specific elements, such as the data type property. These are the property specific-maps:

  • dataTypeMap — Gateway to obtaining information about model elements data type

  • fixPtMap — Gateway to obtaining information about fixed-point information about model elements

  • elementMap — Gateway to obtaining information about Simulink® bus structures

  • sampleTimeMap — Gateway to the sample time of model elements

  • dimensionMap — Gateway to obtaining the number of dimensions of model elements dimensions

  • dimensionArray — Integer array that contains the actual dimensions of model elements

  • dataAddrMap — Pointer array that contains computer memory addresses with the real-time value of model elements

Each entry in these arrays corresponds to a specific value of the property it represents, without being directly associated with any specific model element. For example, a single entry in the dataTypeMap array is reserved for describing the double data type without being associated with any specific model element among those defined as double. Your code uses indices it previously obtained to reference entries in these property-specific arrays to obtain further information about the property it is currently investigating. For example, if your code needs to access information about the data type of the model parameter myParam, your code:

  1. Finds the entry in the model parameters map array that corresponds to myParam.

  2. Gets the value of the dataTypeIndex field from within the entry.

  3. Uses the value as an index to reference the dataTypeMap map array. The referenced entry corresponds to the data type of myParam. This entry also corresponds to all other model elements that have the same data type as myParam.

  4. Gets the necessary information about the data type of myParam, such as the name of the data type and how many bytes of memory it uses.

Print Data Type Names of Model Signals Example

This example uses the C API signal array to access the data type property array and prints the data type names of the model signals. The example code is also provided as standalone code (see Standalone C Code for Printing Data Type Names of Model Signals Example) so that you can copy it more easily.

C Code for Printing Data Type Names of Model Signals Example

DescriptionSample C Code with Direct Data Structure AccessSample C Code with Macros and Get-Functions

Include these header files:

  • AccessCapiDemoMdl.h — The generated model header, so you can access the real-time model object.

  • capiAccessModelSignals.h — The file that contains the declaration of the function provided in the example.

  • rtw_capi.h and rtw_modelmap.h — The files that contain declarations and definitions of the structures accessed and macros used in the example. These files are located in the folder matlabroot/rtw/c/src/.

# include "AccessCapiDemoMdl.h"
# include "rtw_modelmap.h"
# include "rtw_capi.h"
# include "capiPrintSigTypes.h"
# include <stdio.h>
# include "AccessCapiDemoMdl.h"
# include "rtw_modelmap.h"
# include "rtw_capi.h"
# include "capiPrintSigTypes.h"
# include <stdio.h>
Declare variables to use for storing the map objects and the signal information.
const rtwCAPI_ModelMappingInfo *mainCapiMap;
const rtwCAPI_ModelMappingStaticInfo *capiStaticMap;

uint_T sigCount;
const rtwCAPI_Signals *capiSigArr;
const rtwCAPI_DataTypeMap* dataTypeMap;
uint16_T dataTypeInd;
const rtwCAPI_ModelMappingInfo *mainCapiMap;
const rtwCAPI_ModelMappingStaticInfo *capiStaticMap;

uint_T sigCount;
const rtwCAPI_Signals *capiSigArr;
const rtwCAPI_DataTypeMap* dataTypeMap;
uint16_T dataTypeInd;
Get the pointers to the C API model maps (see Obtain Access to C API Maps Example for more details). Then extract the number of signals that are included in the generated C API code, and get the pointer to the signal structure array.
void printModelSignalsDataTypes()
{
  mainCapiMap = &AccessCapiDemoMdl_M->DataMapInfo.mmi;
  capiStaticMap = mainCapiMap->staticMap;

  sigCount = (capiStaticMap->Signals).numSignals;
  capiSigArr = (capiStaticMap->Signals).signals;
void printModelSignalsDataTypes()
{
  mainCapiMap = &rtmGetDataMapInfo(AccessCapiDemoMdl_M).mmi;

  sigCount = rtwCAPI_GetNumSignals(mainCapiMap);
  capiSigArr = rtwCAPI_GetSignals(mainCapiMap);
Get a pointer to the data type map array.
  dataTypeMap = (capiStaticMap->Maps).dataTypeMap;
  dataTypeMap = rtwCAPI_GetDataTypeMap(mainCapiMap);
Print the number of signals in the model and an introductory announcement about their types. Then start a for-loop to go over the signals.
  printf("Found %i signals, with these types:\n",sigCount);
  for(int idx=0 ; idx<sigCount ; idx++)
  {    
  printf("Found %i signals, with these types:\n",sigCount);
  for(int idx=0 ; idx<sigCount ; idx++)
  {
For each signal, get the index that references into the data type map array.
    dataTypeInd = capiSigArr[idx].dataTypeIndex;
    dataTypeInd = rtwCAPI_GetSignalDataTypeIdx(capiSigArr,idx);
Use the index to access the corresponding entry in the data type array and print the name of the data type.
    printf("Signal %i: %s\n",   
             idx,dataTypeMap[dataTypeInd].cDataName);
  }
}
    printf("Signal %i: %s\n",
            idx,rtwCAPI_GetDataTypeCName(dataTypeMap,dataTypeInd);
  }
}

Here is a schematic illustration of the map structure that is accessed by the code in the example:

The names of the signal data types are unsigned int and double.

Standalone C Code for Printing Data Type Names of Model Signals Example

 Ready-to-Copy Standalone C Code

Print Dimensions of Model Signals Example

This example uses the C API signal array and the dimensionMap array to access the dimensionArray and print the actual dimensions of the model signals.

The example code is also provided as standalone code (see Standalone C Code for Printing Dimensions of Model Signals Example) so that you can copy it more easily.

C Code for Printing Dimensions of Model Signals Example

DescriptionSample C Code with Direct Data Structure AccessSample C Code with Macros and Get-Functions

Include these header files:

  • AccessCapiDemoMdl.h — The generated model header, so you can access the real-time model object.

  • capiAccessModelSignals.h — The file that contains the declaration of the function provided in the example.

  • rtw_capi.h and rtw_modelmap.h — The files that contain declarations and definitions of the structures accessed and macros used in the example. These files are located in the folder matlabroot/rtw/c/src/.

# include "AccessCapiDemoMdl.h"
# include "rtw_modelmap.h"
# include "rtw_capi.h"
# include "capiPrintSignalDims.h"
# include <stdio.h>
# include "AccessCapiDemoMdl.h"
# include "rtw_modelmap.h"
# include "rtw_capi.h"
# include "capiPrintSignalDims.h"
# include <stdio.h>
Declare variables to use for storing the map objects and the signal information.
const rtwCAPI_ModelMappingInfo *mainCapiMap;
const rtwCAPI_ModelMappingStaticInfo *capiStaticMap;

uint_T sigCount;
const rtwCAPI_Signals *capiSigArr;

const rtwCAPI_DimensionMap* dimMap;
const int_T* dimArray;

/* Index of signal into the dimension map array */
uint16_T dimMapIdx;

/* Number of dimensions for the element */
uint8_T dimCount;

/* Index of dimension map entry into the dimension array */
uint16_T dimArrIdx;
const rtwCAPI_ModelMappingInfo *mainCapiMap;
const rtwCAPI_ModelMappingStaticInfo *capiStaticMap;

uint_T sigCount;
const rtwCAPI_Signals *capiSigArr;

const rtwCAPI_DimensionMap* dimMap;
const int_T* dimArray;

/* Index of signal into the dimension map array */
uint16_T dimMapIdx;

/* Number of dimensions for the element */
uint8_T dimCount;

/* Index of dimension map entry into the dimension array */
uint16_T dimArrIdx;
Get the pointers to the C API model maps (see Obtain Access to C API Maps Example for more details). Then extract the number of signals that are included in the generated C API code and obtain the pointer to the signal structure array.
void printModelSignalsDimensions()
{
  mainCapiMap = &AccessCapiDemoMdl_M->DataMapInfo.mmi;
  capiStaticMap = mainCapiMap->staticMap;

  sigCount = (capiStaticMap->Signals).numSignals;
  capiSigArr = (capiStaticMap->Signals).signals;
void printModelSignalsDimensions()
{
  mainCapiMap = &rtmGetDataMapInfo(AccessCapiDemoMdl_M).mmi;

  sigCount = rtwCAPI_GetNumSignals(mainCapiMap);
  capiSigArr = rtwCAPI_GetSignals(mainCapiMap);

Get the pointers to:

  1. The dimension map array. Your code uses the corresponding entry in this array as the gateway to accessing the dimension information of the signal.

  2. The (primitive type) dimension array. Your code uses the index from the map array to reference this primitive type array, from which it obtains the actual dimensions of the signal.

  dimMap = (capiStaticMap->Maps).dimensionMap;
  dimArray = (capiStaticMap->Maps).dimensionArray;
  dimMap = rtwCAPI_GetDimensionMap(mainCapiMap);
  dimArray = rtwCAPI_GetDimensionArray(mainCapiMap);
Print the number of signals in the model and an introductory announcement about their dimensions. Then start a for-loop to go over the signals.
  printf("Found %i signals, with these dimensions:\n",
                                             sigCount);
  for(int idx1=0 ; idx1<sigCount ; idx1++)
  {
  printf("Used macros.\n  \
            Found %i signals, with these dimensions:\n",
                                                  sigCount);
  for(int idx1=0 ; idx1<sigCount ; idx1++)
  {
For each signal, get the index that references into the dimension map array.
    dimMapIdx = capiSigArr[idx1].dimIndex;
    dimMapIdx = rtwCAPI_GetSignalDimensionIdx(capiSigArr,idx1);
Use the index to access the corresponding entry in the dimension map and get the number of dimensions and the index to the dimensions array.
    dimCount = dimMap[dimMapIdx].numDims;
    dimArrIdx = dimMap[dimMapIdx].dimArrayIndex;
    dimCount = rtwCAPI_GetNumDims(dimMap,dimMapIdx);
    dimArrIdx = rtwCAPI_GetDimArrayIndex(dimMap,dimMapIdx);
Use dimCount and the index to access the corresponding entries in the dimension array, and then get the actual dimensions of the signal, and print them.
    printf("Signal %i: ",idx1);
    for(int idx2=0 ; idx2<dimCount ; idx2++)
    {
      printf("%i", dimArray[dimArrIdx+idx2]);
      if(idx2 < (dimCount-1))
      {
        printf(" x ");
      }
    }
    printf("\n");
  }
}
    printf("Signal %i: ",idx1);
    for(int idx2=0 ; idx2<dimCount ; idx2++)
    {
      printf("%i", dimArray[dimArrIdx+idx2]);
      if(idx2 < (dimCount-1))
      {
        printf(" x ");
      }
    }
    printf("\n");
  }
}

In this example, your code determines that mySig_1 is a variable with dimensions 7-by-2, and mySig_2 is a variable with dimensions 4-by-5-by-3.

Here is a schematic illustration of the map structure that is accessed by the code in the example:

Standalone C Code for Printing Dimensions of Model Signals Example

 Ready-to-Copy Standalone C Code

C Code Syntax for Accessing Property-Specific C API Arrays

In these tables you can find exhaustive information about how to access property-specific C API arrays. Your code can access each type of property by using the direct approach, or by using get-function-like macros.

C Code for Accessing Data Type C API Information

Required Item / InformationCode for Direct Data Structure AccessCode for Access Through Get-Function-Like Macros
C API model maps
# include "rtw_modelmap.h"

const rtwCAPI_ModelMappingInfo *mainCapiMap;
const rtwCAPI_ModelMappingStaticInfo *capiStaticMap;

mainCapiMap = &AccessCapiDemoMdl_M->DataMapInfo.mmi;
capiStaticMap = mainCapiMap->staticMap;
# include "rtw_modelmap.h"

const rtwCAPI_ModelMappingInfo *mainCapiMap;

mainCapiMap = &rtmGetDataMapInfo(AccessCapiDemoMdl_M).mmi;
Data type map array
# include "rtw_modelmap.h"

const rtwCAPI_DataTypeMap* dataTypeArr;
dataTypeArr = (capiStaticMap->Maps).dataTypeMap;
# include "rtw_modelmap.h"

const rtwCAPI_DataTypeMap* dataTypeMap;
dataTypeMap = rtwCAPI_GetDataTypeMap(mainCapiMap);
Direct information about specific data types
# include "rtw_capi.h"

/* dataTypeArr is the C API data type map array */
/* dataTypeIdx is the zero-based entry index in dataTypeArr */

/* MathWorks data type name, such as real_T */
const char_T* mwDataTypeName;
mwDataTypeName = dataTypeArr[dataTypeIdx].mwDataName;  

/* C language data type name, such as unsigned long */
const char_T* cDataTypeName;
cDataTypeName = dataTypeArr[dataTypeIdx].cDataName;  

/* Number of structure elements, or 0 for non-structure data */
uint16_T structElemCount;
structElemCount = dataTypeArr[dataTypeIdx].numElements;

/* Data size in bytes */
uint16_T dataSize = dataTypeArr[dataTypeIdx].dataSize;

/* Enumerated data type from simstruc_types.h */
uint8_T slDataId = dataTypeArr[dataTypeIdx].slDataId;

/* Is complex */
unsigned int isComplex = dataTypeArr[dataTypeIdx].isComplex;

/* Is data accessed through a pointer */
unsigned int isPointer = dataTypeArr[dataTypeIdx].isPointer;

/* Storage type for enum data types */
uint8_T enumStorageType = dataTypeArr[dataTypeIdx].enumStorageType;
# include "rtw_capi.h"

/* dataTypeArr is the C API data type map array */
/* dataTypeIdx is the zero-based entry index in dataTypeArr */

/* MathWorks data type name, such as real_T */
const char_T* mwDataTypeName;
mwDataName = rtwCAPI_GetDataTypeMWName(dataTypeArr,dataTypeIdx);

/* C language data type name, such as unsigned long */
const char_T* cDataTypeName;
cDataTypeName = rtwCAPI_GetDataTypeCName(dataTypeArr,dataTypeIdx);

/* Number of structure elements, or 0 for non-structure data */
uint16_T structElemCount;
structElemCount = rtwCAPI_GetDataTypeNumElements(dataTypeArr,dataTypeIdx);

/* Data size in bytes */
uint16_T dataSize = rtwCAPI_GetDataTypeSize(dataTypeArr,dataTypeIdx);

/* Enumerated data type from simstruc_types.h */
uint8_T slDataId = rtwCAPI_GetDataTypeSLId(dataTypeArr,dataTypeIdx);

/* Is complex */
unsigned int isComplex = rtwCAPI_GetDataIsComplex(dataTypeArr,dataTypeIdx);

/* Is data accessed through a pointer */
unsigned int isPointer = rtwCAPI_GetDataIsPointer(dataTypeArr,dataTypeIdx);

/* Storage type for enum data types */
uint8_T enumStorageType = rtwCAPI_GetDataEnumStorageType(dataTypeArr,dataTypeIdx);
Indirect information about specific data types, provided as an index that references the C API element map array. For more information about the C API element map, see C Code for Accessing C API Simulink Bus Structure Information (Element Map).
# include "rtw_capi.h"

/* Index into the ElementMap, gives bus structure information */
uint16_T elemMapIndex;
elemMapIndex = dataTypeArr[dataTypeIdx].elemMapIndex;
# include "rtw_capi.h"

/* Index into the ElementMap, gives bus structure information */
uint16_T elemMapIndex;
elemMapIndex = rtwCAPI_GetDataTypeElemMapIndex(dataTypeArr,dataTypeIdx);

C Code for Accessing Fixed-Point C API Information

Required Item / InformationCode for Direct Data Structure AccessCode for Access Through Get-Function-Like Macros
C API model maps
# include "rtw_modelmap.h"

const rtwCAPI_ModelMappingInfo *mainCapiMap;
const rtwCAPI_ModelMappingStaticInfo *capiStaticMap;

mainCapiMap = &AccessCapiDemoMdl_M->DataMapInfo.mmi;
capiStaticMap = mainCapiMap->staticMap;
# include "rtw_modelmap.h"

const rtwCAPI_ModelMappingInfo *mainCapiMap;

mainCapiMap = &rtmGetDataMapInfo(AccessCapiDemoMdl_M).mmi;
Fixed-point map array
# include "rtw_modelmap.h"

const rtwCAPI_FixPtMap* fixPtArr;
fixPtArr = (capiStaticMap->Maps).fixPtMap;
# include "rtw_modelmap.h"

const rtwCAPI_FixPtMap* fixPtArr;
fixPtArr = rtwCAPI_GetFixPtMap(mainCapiMap);
Direct information about specific fixed-point configurations that are used by model elements
# include "rtw_capi.h"

/* fixPtArr is the C API fixed-point map array */
/* fixPtIdx is the zero-based entry index in fixPtArr */

/* Fractional slope */
real_T fracSlope = *( (real_T*)(fixPtArr[fixPtIdx].fracSlopePtr) );

/* Bias value */ 
real_T biasVal = *( (real_T*)(fixPtArr[fixPtIdx].biasPtr) );

/* rtwCAPI_FIX_UNIFORM_SCALING (uniform)
                  or
   rtwCAPI_FIX_NONUNIFORM_SCALING (non-uniform) */
rtwCAPI_FixPtScalingType scaleType;
scaleType = fixPtArr[fixPtIdx].scaleType;

/* Number of bits required to store value */
uint32_T wordLen = fixPtArr[fixPtIdx].wordLen;

/* Exponent value */
int32_T expVal = fixPtArr[fixPtIdx].exponent;

boolean_T isSigned = fixPtArr[fixPtIdx].isSigned;
# include "rtw_capi.h"

/* fixPtArr is the C API fixed-point map array */
/* fixPtIdx is the zero-based entry index in fixPtArr */

/* Fractional slope */
real_T fracSlope = rtwCAPI_GetFxpFracSlope(fixPtArr,fixPtIdx);

/* Bias value */
real_T biasVal = rtwCAPI_GetFxpBias(fixPtArr,fixPtIdx);

/* rtwCAPI_FIX_UNIFORM_SCALING (uniform)
                  or
   rtwCAPI_FIX_NONUNIFORM_SCALING (non-uniform) */
rtwCAPI_FixPtScalingType scaleType;
scaleType = rtwCAPI_GetFxpScaling(fixPtArr,fixPtIdx);

/* Number of bits required to store value */
uint32_T wordLen = rtwCAPI_GetFxpwordLen(fixPtArr,fixPtIdx);

/* Exponent value */
int32_T expVal = rtwCAPI_GetFxpExponent(fixPtArr,fixPtIdx);

boolean_T isSigned = rtwCAPI_GetFxpIsSigned(fixPtArr,fixPtIdx);

To learn more about fixed-point specifications in Simulink, see C Code for Accessing C API Simulink Bus Structure Information (Element Map).

C Code for Accessing Sample Time C API Information

Required Item / InformationCode for Direct Data Structure AccessCode for Access Through Get-Function-Like Macros
C API model maps
# include "rtw_modelmap.h"

const rtwCAPI_ModelMappingInfo *mainCapiMap;
const rtwCAPI_ModelMappingStaticInfo *capiStaticMap;

mainCapiMap = &myModel_M->DataMapInfo.mmi;
capiStaticMap = mainCapiMap->staticMap;
# include "rtw_modelmap.h"

const rtwCAPI_ModelMappingInfo *mainCapiMap;

mainCapiMap = &rtmGetDataMapInfo(AccessCapiDemoMdl_M).mmi;
Sample time map array
# include "rtw_modelmap.h"

const rtwCAPI_SampleTimeMap* sampleTimeArr;
sampleTimeArr = (capiStaticMap->Maps).sampleTimeMap;
# include "rtw_modelmap.h"

const rtwCAPI_DataTypeMap* sampleTimeArr;
sampleTimeArr = rtwCAPI_GetSampleTimeMap(mainCapiMap);
Direct information about specific sample time configurations that are used by model elements
# include "rtw_capi.h"

/* sampleTimeArr is the C API sample time map array */
/* sampleTimeIdx is the zero-based entry index in sampleTimeArr */

/* Sample time period */ 
real_T samplePeriod = *( (real_T*)(sampleTimeArr[sampleTimeIdx].samplePeriodPtr) );

/* Sample time offset */ 
real_T sampleOffset = *( (real_T*)(sampleTimeArr[sampleTimeIdx].sampleOffsetPtr) );

/* Task identifier */
int8_T taskID = sampleTimeArr[sampleTimeIdx].tid;

/* 0 = SampleBased , 1 = FrameBased */
uint8_T sampleMode = sampleTimeArr[sampleTimeIdx].samplingMode;
# include "rtw_capi.h"

/* sampleTimeArr is the C API sample time map array */
/* sampleTimeIdx is the zero-based entry index in sampleTimeArr */

/* Sample time period */ 
real_T samplePeriod = rtwCAPI_GetSamplePeriod(sampleTimeArr,sampleTimeIdx);

/* Sample time offset */ 
real_T sampleOffset = rtwCAPI_GetSampleOffset(sampleTimeArr,sampleTimeIdx);

/* Task identifier */
int8_T taskID = rtwCAPI_GetSampleTimeTID(sampleTimeArr,sampleTimeIdx);

/* 0 = SampleBased , 1 = FrameBased */
uint8_T sampleMode = rtwCAPI_GetSamplingMode(sampleTimeArr,sampleTimeIdx);

C Code for Accessing C API Simulink Bus Structure Information (Element Map)

Required Item / InformationCode for Direct Data Structure AccessCode for Access Through Get-Function-Like Macros
C API model maps
# include "rtw_modelmap.h"

const rtwCAPI_ModelMappingInfo *mainCapiMap;
const rtwCAPI_ModelMappingStaticInfo *capiStaticMap;

mainCapiMap = &AccessCapiDemoMdl_M->DataMapInfo.mmi;
capiStaticMap = mainCapiMap->staticMap;
# include "rtw_modelmap.h"

const rtwCAPI_ModelMappingInfo *mainCapiMap;

mainCapiMap = &rtmGetDataMapInfo(AccessCapiDemoMdl_M).mmi;
Element map array
# include "rtw_modelmap.h"

const rtwCAPI_ElementMap* elemArr;
elemArr = (capiStaticMap->Maps).elementMap;
# include "rtw_modelmap.h"

const rtwCAPI_ElementMap* elemArr;
elemArr = rtwCAPI_GetElementMap(mainCapiMap);
Direct information about specific bus structures in the model
# include "rtw_capi.h"

/* elemIdx is the zero-based entry index in elemArr */

const char_T* elemName = elemArr[elemIdx].elementName;

/* Offset of the structure element in bytes */
uint32_T elemOffset = elemArr[elemIdx].elementOffset;
# include "rtw_capi.h"

/* elemIdx is the zero-based entry index in elemArr */

const char_T* elemName = rtwCAPI_GetElementName(elemArr,elemIdx);

/* Offset of the structure element in bytes */
uint32_T elemOffset = rtwCAPI_GetElementOffset(elemArr,elemIdx);

Indirect information about specific bus structures in the model, provided as indices that reference other C API map arrays. For more information about these C API maps, see:

# include "rtw_capi.h"

/* elemIdx is a zero-based entry index in elemArr */

/* Index into the data type map array */
uint16_T dataTypeIdx = elemArr[elemIdx].dataTypeIndex;

/* Index into the fiexed point map array */
uint16_T  fixPtIdx = elemArr[elemIdx].fxpIndex;

/* Index into the dimension map array */
uint16_T  dimIdx = elemArr[elemIdx].dimIndex;
# include "rtw_capi.h"

/* elemIdx is a zero-based entry index in elemArr */

/* Index into the data type map array */
uint16_T dataTypeIdx = rtwCAPI_GetElementDataTypeIdx(elemArr,elemIdx);

/* Index into the fiexed point map array */
uint16_T  fixPtIdx = rtwCAPI_GetElementFixPtIdx(elemArr,elemIdx);

/* Index into the dimension map array */
uint16_T  dimIdx = rtwCAPI_GetElementDimensionIdx(elemArr,elemIdx);

C Code for Obtaining Element Dimensions Through C API

Required Item / InformationCode for Direct Data Structure AccessCode for Access Through Get-Function-Like Macros
C API model maps
# include "rtw_modelmap.h"

const rtwCAPI_ModelMappingInfo *mainCapiMap;
const rtwCAPI_ModelMappingStaticInfo *capiStaticMap;

mainCapiMap = &AccessCapiDemoMdl_M->DataMapInfo.mmi;
capiStaticMap = mainCapiMap->staticMap;
# include "rtw_modelmap.h"

const rtwCAPI_ModelMappingInfo *mainCapiMap;

mainCapiMap = &rtmGetDataMapInfo(AccessCapiDemoMdl_M).mmi;
Dimension map array
# include "rtw_modelmap.h"

const rtwCAPI_DimensionMap* dimMapArr;
dimMapArr = (capiStaticMap->Maps).dimensionMap;
# include "rtw_modelmap.h"

const rtwCAPI_ElementMap* elemArr;
elemArr = rtwCAPI_GetElementMap(mainCapiMap);
Direct information about specific dimension configuration used by at least one model element

 Dimension Orientation Enumeration


/* dimMapIdx is a zero-based entry index in dimMapArr. */

/* Dimension orientation (see above) */
rtwCAPI_Orientation dimOrient;
dimOrient = dimMapArr[dimMapIdx].orientation;

/* Dimension count */
uint8_T dimCount = dimMapArr[dimMapIdx].numDims;

/* dimMapIdx is a zero-based entry index in dimMapArr. */

/* Dimension orientation (see above) */
rtwCAPI_Orientation dimOrient;
dimOrient = rtwCAPI_GetOrientation(dimMapArr,dimMapIdx);

/* Dimension count */
uint8_T dimCount = rtwCAPI_GetNumDims(dimMapArr,dimMapIdx);
Indirect information about the specific dimension configuration, provided as an index into the (primitive type) C API dimension array

/* dimMapIdx is a zero-based entry index in dimMapArr. */

/* Zero-based index into the dimension array */
uint_T dimArrIdx = dimMapArr[dimMapIdx].dimArrayIndex;

/* dimMapIdx is a zero-based entry index in dimMapArr. */

/* Zero-based index into the dimension array */
uint_T dimArrIdx = = rtwCAPI_GetDimArrayIndex(dimMapArr,dimMapIdx);

Related Topics