You can convert data values from numeric to hexadecimal or binary according to a
quantizer
object's specifications.
Use
For example,
q = quantizer([3 2]); x = [0.75 -0.25 0.50 -0.50 0.25 -0.75 0 -1 ]; b = num2bin(q,x)
b = 8×3 char array '011' '010' '001' '000' '111' '110' '101' '100'
produces all two's complement fractional representations of 3-bit fixed-point numbers.