Lookup Table Error: Values of 'Breakpoin​tsForDimen​sion1' in 'Model' must be strictly monotonically increasing.

170 views (last 30 days)
There are already many question related to this topic, I rad them through and couldn't find a solution to this issue. Forgive me if the question is repeating.
As you can see in the picture the lookup table has monotonically increasing values of both breakpoints.
The column values are increasing with the stepsize(2) until the end, i.e. 40 to 154 (58 entries)
The row values are increasing with the stepsize(5) until the end, i.e. 115 to 280 (34 entries)
(is it because the column and row stepsize are different?)
Can someone please help to understand why does it keep showing the same error? Any advise or help would be great!
Error message : Values of 'BreakpointsForDimension1' in 'Model_xyz' must be strictly monotonically increasing. The problem occurs at element 2. Change the breakpoints data or use the fixed-point tools such as Auto Scaling or Fixed-Point Advisor to determine a different parameter dialog type.

Accepted Answer

Andy Bartlett
Andy Bartlett on 7 Mar 2022
Edited: Andy Bartlett on 8 Mar 2022
Please check the data type specified for the breakpoints.
Quantization of the original value to the specified run-time data type could cause repeated values.
Example 1 Parameter type is int8
vOrig1 = 115:5:135
dtName1 = 'int8';
vQuantized1 = cast(vOrig1,dtName1)
outputs
vOrig1 =
115 120 125 130 135
vQuantized1 =
1×5 int8 row vector
115 120 125 127 127
Notice that the last two values are equal and thus not monotonically increasing.
Example 2 Parameter type Fixed-Point
Orig2 = 40:2:46
nt2 = numerictype(1,8,2)
vQuantized2 = fi(vOrig2,nt2)
outputs
vOrig2 =
40 42 44 46
nt2 =
DataTypeMode: Fixed-point: binary point scaling
Signedness: Signed
WordLength: 8
FractionLength: 2
vQuantized2 =
31.7500 31.7500 31.7500 31.7500
DataTypeMode: Fixed-point: binary point scaling
Signedness: Signed
WordLength: 8
FractionLength: 2
Notice that all the values are equal and thus not monotonically increasing.
Example 3 Parameter type Single
vOrig3 = 2^25 + (1:5)
dtName3 = 'single';
vQuantized3 = cast(vOrig3,dtName3)
outputs
vOrig3 =
33554433 33554434 33554435 33554436 33554437
vQuantized3 =
1×5 single row vector
33554432 33554432 33554436 33554436 33554436
Notice that the first two values are equal and the last three values are equal, thus the vector of breakpoints is not monotonically increasing.
  4 Comments
Andy Bartlett
Andy Bartlett on 25 Aug 2022
Like most blocks, the Lookup Table block does not set the data types for its inputs.
It inherits them from the block upstream that outputs the signal that become the Lookup's input.
Hint 1: Turn on Display Port Data Types to make it easier investigate type related issues.
Hint 2: If you don't understand a type from it's name such as 'sfix16_En3', just feed the name to numerictype
nt = numerictype('sfix16_En3')
nt =
DataTypeMode: Fixed-point: binary point scaling
Signedness: Signed
WordLength: 16
FractionLength: 3
You can also look at some key attributes of the type
minMaxRepresentable = nt.range
representableValueSpacingIntegerOrFixedPoint = nt.Slope
minMaxRepresentable =
-4096 4095.875
numerictype(1,16,3)
representableValueSpacingIntegerOrFixedPoint =
0.125

Sign in to comment.

More Answers (0)

Products


Release

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!