You can use the Simulation Data Inspector to inspect and compare floating-point and fixed-point logged input and output data. In the Fixed-Point Conversion tool:
Click Advanced.
In the Advanced Settings dialog box, set Plot with Simulation Data
Inspector to Yes
.
At the Test Numerics stage in the conversion process, click Test
Numerics, select Log inputs and outputs for
comparison plots
, and then click .
For an example, see Propose Fixed-Point Data Types Based on Derived Ranges.
You can use the Simulation Data Inspector to inspect and compare floating-point and fixed-point input and output data logged using the function. At the MATLAB® command line:
Create a fixed-point configuration object and configure the test file name.
fixptcfg = coder.config('fixpt'); fixptcfg.TestBenchName = 'dti_test';
Select to run the test file to verify the generated fixed-point MATLAB code. Log inputs and outputs for comparison plotting and select to use the Simulation Data Inspector to plot the results.
fixptcfg.TestNumerics = true; fixptcfg.LogIOForComparisonPlotting = true; fixptcfg.PlotWithSimulationDataInspector = true;
Generate fixed-point MATLAB code using codegen
.
codegen -float2fixed fixptcfg -config cfg dti
For an example, see Propose Fixed-Point Data Types Based on Derived Ranges.