Main Content

Implement logic signals as Boolean data (vs. double)

Logic signal data type

Model Configuration Pane: Math and Data Types

Description

The Implement logic signals as Boolean data (vs. double) parameter specifies whether the data type for logical signals is Boolean or double. Using Boolean values instead of double values reduces memory requirements for generated code. A Boolean value typically requires one byte of storage, while a double value requires eight bytes of storage.

This parameter affects these blocks:

Dependencies

To enable this parameter, you must create your model with a version of Simulink® that supports both double and Boolean signals.

Settings

on (default) | off
On

Blocks that generate logic signals produce Boolean output values.

Off

Blocks that generate logic signals produce double output values.

This setting ensures compatibility with models created using a version of Simulink that does not support Boolean signals.

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
Efficiencyon
Safety precautionon

Programmatic Use

Parameter: BooleanDataType
Type: string | character vector
Values: 'on' | 'off'
Default: 'on'

Version History

Introduced in R2008a