Main Content

Data Types Supported by Simulink

Simulink® supports all built-in numeric MATLAB® data types. The term built-in data type refers to data types defined by MATLAB itself as opposed to data types defined by MATLAB users. Unless otherwise specified, the term data type in the Simulink documentation refers to built-in data types.

The following table lists the built-in MATLAB data types supported by Simulink.

NameDescription

double

Double-precision floating point

single

Single-precision floating point

int8

Signed 8-bit integer

uint8

Unsigned 8-bit integer

int16

Signed 16-bit integer

uint16

Unsigned 16-bit integer

int32

Signed 32-bit integer

uint32

Unsigned 32-bit integer

int64

Signed 64-bit integer

uint64

Unsigned 64-bit integer

half

Half-precision floating point (requires Fixed-Point Designer™ license)

string

Text

Some model elements do not support all data types. For more information on the data types supported by a specific block for parameter and input and output values, see the Data Type Support section of the reference page for that block.

Besides these built-in types, Simulink defines a boolean (true or false) type. The values 1 and 0 represent true and false respectively. For this data type, Simulink represents real, nonzero numeric values (including Inf) as true (1).

Block Support for Data and Signal Types

All Simulink blocks accept signals of type double by default. Some blocks prefer boolean input and others support multiple data types on their inputs. For more information on the data types supported by a specific block for parameter and input and output values, see the reference page for that block. If the documentation for a block does not specify a data type, the block inputs or outputs only data of type double.

Several blocks support bus objects (Simulink.Bus) as data types. See Data Types for Buses.

Many Simulink blocks also support fixed-point data types. For more information about fixed-point data, see Specify Fixed-Point Data Types. For more information on the data types supported by a specific block for parameter and input and output values, in the Simulink documentation see the Data Type Support section of the reference page for that block. If the documentation for a block does not specify a data type, the block inputs or outputs only data of type double.

To specify an image of the Simulink.ImageType (Computer Vision Toolbox) data type and generate code for the model, use the Computer Vision Toolbox™. Specify this data type for signals and other data in the model. The Simulink.ImageType data type is an encapsulated object that defines an image that has fixed meta-attributes specific to this data type.

To view a table that summarizes the data types supported by the blocks in the Simulink block libraries, execute the following command at the MATLAB command line:

showblockdatatypetable

See Also

| | (Computer Vision Toolbox)

Related Topics