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

47 ビュー (過去 30 日間)
Garvit Amipara
Garvit Amipara 2022 年 3 月 6 日
編集済み: Garvit Amipara 2022 年 3 月 8 日
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.

採用された回答

Andy Bartlett
Andy Bartlett 2022 年 3 月 7 日
編集済み: Andy Bartlett 2022 年 3 月 8 日
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.
  2 件のコメント
Garvit Amipara
Garvit Amipara 2022 年 3 月 8 日
For anyone having the similar problem as mentioned above, it is possible that there are better solutions.
Change the Input Data Type from the properties of the n-D Lookuptable block. The matrix and vector values in my files were 'double' . One way would be to change the data type. I had less time and was afraid that the original values might change while trying to change the data type with any commands. So I did not touch the matrix and vectors. Just by choosing 'int32' for the table and breakpoint 'input data type' worked.

サインインしてコメントする。

その他の回答 (0 件)

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by