MATLAB: How to obtain information about data type IDs for Level 2 MATLAB file S-functions in Simulink 6.1 (R14SP1)

codedata typedatatypedatatypeiddatatypenamem-filenumbers-functionsimulink

I am creating a Level 2 MATLAB file S-function that uses data types other than "double".
The Level 2 MATLAB File S-Function template, msfuntmpl.m, contains the following lines:
% Override input port properties
block.InputPort(1).DatatypeID = 0; % double
However, there is no information about a DatatypeID for other valid data types such as "int", "single", and "boolean".

Best Answer

This enhancement has been incorporated in Release 2006b (R2006b). For previous product releases, read below for any possible workarounds:
Information on the DatatypeID method associated with Level 2 MATLAB file S-functions is missing from the Simulink documentation.
Here is additional information about setting DatatypeIDs for data types other than "double":
The DatatypeID of input/output ports can be one of the following numbers:
-1 for inherited data types
0 for “double”
1 for “single”
2 for “int8”
3 for “uint8”
4 for “int16”
5 for “uint16”
6 for “int32”
7 for “uint32”
8 for “boolean”
14 for fixed-point data types
Alternatively, you can use the following line of code:
block.DatatypeName(id)
to map any data type ID specified by "id" back to its corresponding data type name.