How to Troubleshoot Discrete Levels
If you run computations in the MATLAB mathematics program, you may occasionally see a “discrete levels” error message while running a calculation. This refers to a process that require only integers. If the program detects a non-integer in the system, it will deliver the error message. You can always remove non-integers manually, but if you want to keep your data intact, you can automatically add an integer-rounding function to your calculation -- to get all the numbers as discrete levels, without affecting the underlying data.
Instructions
-
-
1
Open your data set in MATLAB.
-
2
Type the calculation you want to perform into the input window, but do not hit Enter.
-
-
3
Place “uint8(” -- without quotes -- right before the name of your dataset in the command. Place ")” after the name. For instance, if you are working in MyData1, it would look like “uint8(MyData1)”.
-
4
Hit Enter. The calculation will now convert numbers to discrete-level integers as it runs, avoiding the error message.
-
1