MATLAB: What are the valid DataTypeID values for MATLAB file S-Functions in Simulink

datatypedatatypeidfieldspossibles-functionsimulinkvalue

The Level 2 MATLAB file S-Function example, msfuntmpl, contains the following two lines:
% Override input port properties
block.InputPort(1).DatatypeID = 0; % double
There is no indication of what other valid data types might be.

Best Answer

Information on the DatatypeIDs associated with Level 2 MATLAB file S-functions is missing from the Simulink documentation. DatatypeID of an input port must be one of the following:
-1 for 'inherited',
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"
For more information on these properties of S-Functions in Simulink, please refer to the following link: