Convert Fixed-Point Conversion Project to MATLAB Scripts
You can convert an existing Fixed-Point
Converter app project to a MATLAB® script. You can use the -tocode option of the
fixedPointConverter command to create a script for fixed-point
conversion. You can use the script to repeat the project workflow in a command-line
workflow. Before you convert the project to a script, you must complete the
Test step of the fixed-point conversion process.
Generate Scripts
Change to the folder that contains the project file.
Use the
-tocodeoption of thefixedPointConvertercommand to convert the project to a script. Use the-scriptoption to specify the file name for the script.fixedPointConverter -tocode conversion_project.prj -script conversion_project_script.m
The
fixedPointConvertercommand generates a script in the current folder.conversion_project_script.mcontains the MATLAB commands to:Create a floating-point to fixed-point conversion configuration object that has the same fixed-point conversion settings as the project.
Run the
fiaccelcommand to convert the MATLAB functionconversion_projectto the fixed-point MATLAB functionconversion_project_fixpt.
The
fiaccelcommand overwrites existing files that have the same name as the generated script. If you omit the-scriptoption, thefiaccelcommand returns the script in the Command Window.
Run Script That Generates Fixed-Point MATLAB Code
If you want to regenerate the fixed-point function, use the generated script.
Make sure that the current folder contains the entry-point function
conversion_project.mand the associated test bench fileconversion_project_test.m.Run the script.
conversion_project_script
The script generates
conversion_project_fixpt.min the foldercodegen\conversion_project\fixpt. The variablescfgandARGSappear in the base workspace.
See Also
Topics
- Convert MATLAB Code to Fixed-Point C Code (MATLAB Coder)