MATLAB: Do I get this error when I am using fxpopt for fixed-point Optimization: Inconsistent numeric values for port 1 …

fixed-pointfxpopt

Why do I get this error:
Inconsistent numeric values for port 1 of 'mDesignRange/output_signal': Output value (24.774542937654335) at major time step 33 is greater than maximum (20) from 'mDesignRange/output_signal'
when I am using fxpopt for fixed-point optimization?

Best Answer

This happens when your model simulation violates your design ranges (min, max specifications). Fxpopt throws this error, as it considers design ranges to be a hard requirement for your system specification and when the simulation violates the specification, fxpopt considers your model to be in faulty state.
A quick way to test this is to turn on the signal range checking by running the following command:
sim(model, 'SignalRangeChecking', 'error')
You can either update the design ranges or investigate why the simulation violates these ranges.