Contenuto principale

Simulink.NumericType Property Dialog Box

Use a Simulink.AliasType object to set and share data types for signal, state, and parameter data in a model. For examples and programmatic information, see Simulink.NumericType.

Default view of the Simulink.NumericType property dialog box with the Design tab displayed

Data type mode

Data type of this numeric type. The options are listed in this table.

Option

Description

Double

Same as the MATLAB® double type.

Single

Same as the MATLAB single type.

Boolean

Same as the MATLAB boolean type.

Fixed-point: unspecified scaling

A fixed-point data type with unspecified scaling.

Fixed-point: binary point scaling

A fixed-point data type with binary-point scaling.

Fixed-point: slope and bias scaling

A fixed-point data type with slope and bias scaling.

Selecting a data type mode causes Simulink® software to enable controls on the dialog box that apply to the mode and to disable other controls that do not apply. Selecting a fixed-point data type mode can, depending on the other dialog box options that you select, cause the model to run only on systems that have a Fixed-Point Designer™ option installed.

Data type override

Data type override setting for this numeric type. The options are listed in this table.

Option

Description

Inherit (default)

Data type override setting for the context in which this numeric type is used (block, signal, Stateflow® chart in Simulink) applies to this numeric type.

Off

Data type override setting does not affect this numeric type.

Is alias

If you select this option for a workspace object of this type, Simulink software uses the name of the object as the data type for all objects that specify the object as its data type. Otherwise, Simulink software uses the data type mode of the data type as its name, or, if the data type mode is a fixed-point mode, Simulink software generates a name that encodes the type properties, using the encoding specified by Fixed-Point Designer.

Data scope

Specifies whether the data type definition is imported from, or exported to, a header file during code generation. The possible values are listed in this table.

ValueAction
Auto (default)If no value is specified for Header file, export the type definition to model_types.h. model is the model name.

If a value is specified for Header file, import the data type definition from the specified header file.
ExportedExport the data type definition to a header file, which can be specified in the Header file field. If no value is specified for Header file, the header file name defaults to type.h. type is the data type name.
ImportedImport the data type definition from a header file, which can be specified in the Header file field. If no value is specified for Header file, the header file name defaults to type.h. type is the data type name.
Header file

Name of a C header file from which a data type definition is imported, or to which a data type definition is exported, based on the value of Data scope. If this field is specified, the specified name is used during code generation for importing or exporting. If this field is empty, the value defaults to type.h if Data scope equals Imported or Exported, or defaults to model_types.h if Data scope equals Auto.

By default, the generated #include directive uses the preprocessor delimiter " instead of < and >. To generate the directive #include <myTypes.h>, specify Header file as <myTypes.h>.

Description

Description of this data type. This field is intended for use in documenting this data type. Simulink software ignores it.

Signedness

Specifies whether the data type is signed or unsigned, or inherits its signedness. Set the option to Signed, Unsigned, or Auto. This option is enabled only for fixed-point data type modes as shown.

View of the Simulink.NumericType property dialog box with the Design tab displayed. A fixed-point data type mode is selected and fixed-point specific options are enabled.

Word length

Word length in bits of the fixed-point data type. This option is enabled only for fixed-point data type modes.

Fraction length

Number of bits to the right of the binary point. This option is enabled only if the data type mode is Fixed-point: binary point scaling.

View of the Simulink.NumericType property dialog box with the Design tab displayed. Because the data type mode "Fixed-point: binary point scaling" is selected, the Fraction length option is enabled.

Slope

Slope for slope and bias scaling. This option is enabled only if the data type mode is Fixed-point: slope and bias scaling.

View of the Simulink.NumericType property dialog box with the Design tab displayed. Because the data type mode "Fixed-point: slope and bias scaling" is selected, the Slope option is enabled.

Bias

Bias for slope and bias scaling. This option is enabled only if the data type mode is Fixed-point: slope and bias scaling. See the preceding figure.

See Also