Main Content

Specify Data Types Using Data Type Assistant

R2026b

The Data Type Assistant is an interactive graphical tool that simplifies the task of specifying data types for blocks and data objects. The assistant appears on block and object dialog boxes, adjacent to parameters that provide data type control, such as the Output data type parameter. For example, it appears on the Signal Attributes tab of the Block Parameters dialog box for the Constant block.

The Data Type Assistant appears below the data type parameter in the Constant block parameters dialog box.

For these objects, access to the Data Type Assistant is from a tool:

  • Simulink.BusElement objects — Access is from the Type Editor.

  • Simulink.Signal and Simulink.Parameter objects — Access is from Model Explorer.

Show or hide the Data Type Assistant by clicking the applicable button:

  • Click the Show data type assistant button to display the assistant.

  • Click the Hide data type assistant button to hide a visible assistant.

To use the Data Type Assistant to specify a data type:

  1. From the Mode list, select the category of data type that you want to specify. In general, these options are included.

    ModeDescriptionRelated Information

    Inherit

    A rule that determines how the output signal inherits its data type.

    Data Type Inheritance Rules

    Built in

    A built-in data type for a block or data object.

    Built-In Data Types

    Fixed point

    A fixed-point data type for a block or data object.

    Enumerated

    An enumerated object as a data type for a block.

    Use Enumerated Data in Simulink Models

    Bus object

    A Simulink.Bus object as a data type for a block or data object.

    Image

    A Simulink.ImageType object as a data type for a block or data object (Computer Vision Toolbox™).

    Simulink.ImageType (Computer Vision Toolbox)

    Value type

    A Simulink.ValueType object as a data type for a block or Simulink.BusElement object.

    Expression

    An expression that evaluates to a numeric data type object.

    Data Type Expressions

    The assistant changes dynamically to display different options that correspond to the selected mode. For example, setting Mode to Expression in the Block Parameters dialog box for a Constant block updates the values in the boxes next to Output data type and Mode.

    The Constant block parameters dialog box shows that the value for each box is now <data type expression>.

  2. To the right of the Mode list, select or enter a data type.

    For example, suppose you designate the variable myDataType as an alias for a single data type. You create an instance of the Simulink.AliasType class and set its BaseType property by entering these commands.

    myDataType = Simulink.AliasType
    myDataType.BaseType = 'single'

    You can use this data type object to specify the output data type of a Constant block. Enter the data type alias name, myDataType, as the value of the expression in the assistant.

    The value for each box is now myDataType.

  3. Click OK or Apply to apply your changes.

    The assistant uses the data type that you specified to populate the associated data type parameter in the block or object dialog box. For example, the Output data type parameter of the Constant block specifies the same expression that you entered using the assistant.

    The boxes no longer have formatting that indicates the values are modified.

For more information about the data types that you can specify using the Data Type Assistant, see Entering Valid Data Type Values. For details about specifying fixed-point data types, see Specify Fixed-Point Data Types with the Data Type Assistant (Fixed-Point Designer).

See Also

| | (Computer Vision Toolbox)

Topics