Main Content

Specify Type Proposal Options

To view type proposal options, in the MATLAB® Coder™ app, on the Convert to Fixed Point page, click the Settings arrow .

The following options are available.

Basic Type Proposal SettingsValuesDescription

Fixed-point type proposal mode

Propose fraction lengths for specified word length

Use the specified word length for data type proposals and propose the minimum fraction lengths to avoid overflows.

Propose word lengths for specified fraction length (default)

Use the specified fraction length for data type proposals and propose the minimum word lengths to avoid overflows.

Default word length

16 (default)

Default word length to use when Fixed-point type proposal mode is set to Propose fraction lengths for specified word lengths

Default fraction length

4 (default)

Default fraction length to use when Fixed-point type proposal mode is set to Propose word lengths for specified fraction lengths

Advanced Type Proposal SettingsValuesDescription

When proposing types

Note

Manually-entered static ranges always take precedence over simulation ranges.

ignore simulation ranges

Propose data types based on derived ranges.

ignore derived ranges

Propose data types based on simulation ranges.

use all collected data (default)

Propose data types based on both simulation and derived ranges.

Propose target container types

Yes

Propose data type with the smallest word length that can represent the range and is suitable for C code generation ( 8,16,32, 64 … ). For example, for a variable with range [0..7], propose a word length of 8 rather than 3.

No (default)

Propose data types with the minimum word length needed to represent the value.

Optimize whole numbers

No

Do not use integer scaling for variables that were whole numbers during simulation.

Yes (default)

Use integer scaling for variables that were whole numbers during simulation.

Signedness

Automatic (default)

Proposes signed and unsigned data types depending on the range information for each variable.

Signed

Propose signed data types.

Unsigned

Propose unsigned data types.

Safety margin for sim min/max (%)

0 (default)

Specify safety factor for simulation minimum and maximum values.

The simulation minimum and maximum values are adjusted by the percentage designated by this parameter, allowing you to specify a range different from that obtained from the simulation run. For example, a value of 55 specifies that you want a range at least 55 percent larger. A value of -15 specifies that a range up to 15 percent smaller is acceptable.

Search paths

'' (default)

Add paths to the list of paths to search for MATLAB files. Separate list items with a semicolon.

fimath SettingsValuesDescription

Rounding method

Ceiling

Specify the fimath properties for the generated fixed-point data types.

The default fixed-point math properties use the Floor rounding and Wrap overflow because they are the default actions in C. These settings generate the most efficient code but might cause problems with overflow.

After code generation, if required, modify these settings to optimize the generated code, or example, avoid overflow or eliminate bias, and then rerun the verification.

For more information on fimath properties, see fimath Object Properties (Fixed-Point Designer).

Convergent

Floor (default)

Nearest

Round

Zero

Overflow action

Saturate

Wrap (default)

Product mode

FullPrecision (default)

KeepLSB

KeepMSB

SpecifyPrecision

Sum mode

FullPrecision (default)

KeepLSB

KeepMSB

SpecifyPrecision

Generated File SettingsValueDescription

Generated fixed-point file name suffix

_fixpt (default)

Specify the suffix to add to the generated fixed-point file names. For example, by default, if you generate a static library for a project named test, the generated files are in the subfolder codegen\lib\test_fixpt. The generated static library is named test.lib, but the generated C code files use the suffix, for example, test_fixpt.c.

Plotting and Reporting SettingsValuesDescription

Custom plot function

'' (default)

Specify the name of a custom plot function to use for comparison plots.

Plot with Simulation Data Inspector

No (default)

Specify whether to use the Simulation Data Inspector for comparison plots.

Yes

Highlight potential data type issues

No (default)

Specify whether to highlight potential data types in the generated html report. If this option is turned on, the report highlights single-precision, double-precision, and expensive fixed-point operation usage in your MATLAB code.

Yes