| Contents | Index |
You construct a quantizer object to specify the quantization parameters to use when you quantize data sets. You can use the quantize function to quantize data according to a quantizer object's specifications.
Once you quantize data with a quantizer object, its state values might change.
The following example shows
How you use quantize to quantize data
How quantization affects quantizer object states
How you reset quantizer object states to their default values using reset
Construct an example data set and a quantizer object.
format long g randn('state',0); x = randn(100,4); q = quantizer([16,14]);
Retrieve the values of the maxlog and noverflows states.
q.maxlog
ans =
-1.79769313486232e+308
q.noverflows
ans =
0Note that maxlog is equal to -realmax, which indicates that the quantizer q is in a reset state.
Quantize the data set according to the quantizer object's specifications.
y = quantize(q,x); Warning: 15 overflows.
Check the values of maxlog and noverflows.
q.maxlog
ans =
1.99993896484375
q.noverflows
ans =
15Note that the maximum logged value was taken after quantization, that is, q.maxlog == max(y).
Reset the quantizer states and check them.
reset(q)
q.maxlog
ans =
-1.79769313486232e+308
q.noverflows
ans =
0![]() | quantizer Object Properties | Transformations for Quantized Data | ![]() |

Learn how to apply early verification to your development process through these technical resources.
How much time do you spend on testing to ensure implementation meets system-level requirements?
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |