This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Constructor for unitquantizer object


q = unitquantizer(...)


q = unitquantizer(...) constructs a unitquantizer object, which is the same as a quantizer object in all respects except that its quantize method quantizes numbers within eps(q) of +1 to exactly +1.

See quantizer for parameters.


In this example, a vector x is quantized by a unitquantizer object u .

u = unitquantizer([4 3]);
x = (0.8:.1:1.2)';
y = quantize(u,x);
z = [x y]
e = eps(u)

This quantization outputs an array containing the original values of x and the values of x that were quantized by the unitquantizer object u. The output also includes e, the value of eps(u).

z =

    0.8000    0.7500
    0.9000    1.0000
    1.0000    1.0000
    1.1000    1.0000
    1.2000    1.0000

e =


Introduced in R2008a