溢出和精度损失检测
调试溢出和精度损失的来源,并与浮点行为进行比较
识别、跟踪和调试溢出、精度损失以及范围或精度浪费的来源。将嵌入式实现与理想浮点行为进行比较。
函数
fixed.unifiedErrorCalculator.absoluteError | Absolute error of two numeric inputs (自 R2023b 起) |
fixed.unifiedErrorCalculator.bitsOfError | Bits of error of two numeric inputs (自 R2023b 起) |
fixed.unifiedErrorCalculator.relativeAbsoluteError | Relative absolute error of two numeric inputs (自 R2023b 起) |
主题
MATLAB
- Data Type Override Preferences Using fipref
Data type override using thefipref
object. - Underflow and Overflow Logging Using fipref
Examples of usingfipref
objects to set logging preferences forfi
objects. - Visualize Differences Between Floating-Point and Fixed-Point Results
Use a custom plot function to compare the behavior of the generated fixed-point code against the behavior of the original floating-point MATLAB® code. - Enable Plotting Using the Simulation Data Inspector
Inspect and compare floating-point and fixed-point logged input and output data. - Custom Plot Functions
Visualize numerical differences during fixed-point conversion. - Detect Overflows
Detect overflows using the app.
Simulink
- Use the Fixed-Point Tool to Explore Numerical Behavior
Example showing how to use the Fixed-Point Tool to compare floating-point and fixed-point data types. - 处理 Simulink 模型中的溢出
控制当模型包含溢出时收到的警告消息。 - Net Slope and Net Bias Precision
Net slope and bias precision, detecting precision loss, underflow, and overflow. - Detect Fixed-Point Constant Precision Loss
This example shows how to detect fixed-point constant precision loss. - Use Scaled Doubles to Avoid Precision Loss
How to avoid precision loss by overriding the data types in your model with scaled doubles.