| Contents | Index |
DTypeId ssGetDTypeIdFromMxArray(const mxArray *m)
The data type ID of an S-function parameter represented by a MATLAB array. Returns INVALID_DTYPE_ID if the MATLAB data type does not map to any built-in Simulink data type ID.
This function returns an enumerated type representing the data type. The enumerated type DTypeId is defined in simstruc_types.h. The following table shows the equivalency of Simulink, MATLAB, and C data types.
| Simulink Data Type DTypeId | Simulink Data Type DTypeId Index | MATLAB Data Type mxClassID | C Data Type |
|---|---|---|---|
| SS_DOUBLE | 0 | mxDOUBLE_CLASS | real_T |
| SS_SINGLE | 1 | mxSINGLE_CLASS | real32_T |
| SS_INT8 | 2 | mxINT8_CLASS | int8_T |
| SS_UINT8 | 3 | mxUINT8_CLASS | uint8_T |
| SS_INT16 | 4 | mxINT16_CLASS | int16_T |
| SS_UINT16 | 5 | mxUINT16_CLASS | uint16_T |
| SS_INT32 | 6 | mxINT32_CLASS | int32_T |
| SS_UINT32 | 7 | mxUINT32_CLASS | uint32_T |
| SS_BOOLEAN | 8 | mxUINT8_CLASS+ logical | boolean_T |
If a MATLAB data type, for example mxSTRUCT_CLASS, does not map to any Simulink data type, the return value is INVALID_DTYPE_ID. Otherwise the return value is one of the enum values in DTypeId. For example, for mxUINT16_CLASS, the return value is SS_UINT16.
C, C++
See the S-function sfun_dtype_param.c used in sfcndemo_dtype_param.mdl to learn how to use data typed parameters in an S-function.

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 |