Fixed-Point Converter
Convert MATLAB code to fixed point
Description
The Fixed-Point Converter app converts floating-point MATLAB® code to fixed-point MATLAB code.
Using the app, you can:
Propose data types based on simulation range data, static range data, or both.
Propose fraction lengths based on default word lengths or propose word lengths based on default fraction lengths.
Optimize whole numbers.
Specify safety margins for simulation min/max data.
View a histogram of bits used by each variable.
Specify replacement functions or generate approximate functions for functions in the original MATLAB algorithm that do not support fixed point.
Test the numerical behavior of the fixed-point code. You can then compare its behavior against the floating-point version of your algorithm using either the Simulation Data Inspector or your own custom plotting functions.
If your end goal is to generate fixed-point C code, use the MATLAB Coder™ app instead. See Convert MATLAB Code to Fixed-Point C Code (MATLAB Coder).
If your end goal is to generate HDL code, use the HDL Coder™ workflow advisor instead. See Floating-Point to Fixed-Point Conversion (HDL Coder).
Open the Fixed-Point Converter App
MATLAB Toolstrip: On the Apps tab, under Code Generation, click the app icon.
MATLAB command prompt: Enter
fixedPointConverter
.To open an existing Fixed-Point Converter app project, either double-click the
.prj
file or open the app and browse to the project file.Creating a project or opening an existing project causes any other Fixed-Point Converter or MATLAB Coder projects to close.
A MATLAB Coder project opens in the MATLAB Coder app. To convert the project to a Fixed-Point Converter app project, in the MATLAB Coder app:
Click and select Reopen project as.
Select
Fixed-Point Converter
.
Examples
Programmatic Use
Version History
Introduced in R2014b