quantizer object to data
y = quantize(q, x)
[y1,y2,...] = quantize(q,x1,x2,...)
y = quantize(q, x) uses the
x is a numeric
array, each element of
x is quantized. When
a cell array, each numeric element of the cell array is quantized.
x is a structure, each numeric field of
quantized. Quantize does not change nonnumeric elements or fields
x, nor does it issue warnings for nonnumeric
values. The output
y is a built-in double. When
x is a structure or cell array, the fields
y are built-in doubles.
[y1,y2,...] = quantize(q,x1,x2,...) is
y1 = quantize(q,x1), y2 = quantize(q,x2),...
quantizer object states
max — Maximum value before
min — Minimum value before
noverflows — Number of overflows
nunderflows — Number of
noperations — Number of
are updated during the call to
and running totals are kept until a call to
The following example demonstrates using
quantize to quantize data.
u=linspace(-15, 15, 1000); q=quantizer([6 3], 'float'); range(q)
ans = -14 14
y=quantize(q, u); plot(u, y); title(tostring(q))
Warning: 68 overflow(s) occurred in the fi quantize operation.