Writing S-Functions    
ssGetDTypeIdFromMxArray

Get the data type of an S-function parameter.

Syntax

Arguments

m
   MATLAB array representing the parameter.

Description

Returns the data type of an S-function parameter represented by a MATLAB array. This macro returns an enumerated type representing the data type. The enumerated type DTypeId is defined in simstruc.h. The following table shows the equivalency of Simulink, MATLAB, and C data types.

Simulink Data Type
DTypeId
MATLAB Data Type
mxClassID

C- Data Type

SS_DOUBLE
mxDOUBLE_CLASS
real_T
SS_SINGLE
mxSINGLE_CLASS
real32_T
SS_INT8
mxINT8_CLASS
int8_T
SS_UINT8
mxUINT8_CLASS
uint8_T
SS_INT16
mxINT16_CLASS
int16_T
SS_UINT16
mxUINT16_CLASS
uint16_T
SS_INT32
mxINT32_CLASS
int32_T
SS_UINT32
mxUINT32_CLASS
uint32_T
SS_BOOLEAN
mxUINT8_CLASS+ logical
boolean_T

ssGetDTypeIdFromMxArray returns INVALID_DTYPE_ID if the mxClassId does not map to any built-in Simulink data type ID. For example, if mxId == mxSTRUCT_CLASS, the return value is INVALID_DTYPE_ID. Otherwise the return value is one of the enum values in BuiltInDTypeId. For example, if mxId == mxUINT16_CLASS, the return value is SS_UINT16.

Example

See the example in matlabroot/simulink/src/sfun_dtype_param.c to learn how to use data typed parameters in an S-function.

Languages

C

See Also

ssGetSFcnParam


  ssGetDiscStates ssGetDWork