Main Content
num2hex
Convert number to hexadecimal equivalent using quantizer
object
Syntax
Description
Examples
Input Arguments
Output Arguments
Tips
num2hex
andhex2num
are inverses of each other, except thathex2num
returns the hexadecimal values in a column.
Algorithms
For fixed-point
quantizer
objects, the representation is two's complement.For floating-point
quantizer
objects, the representation is IEEE® Standard 754 style.For example, for
q = quantizer('double')
:q = quantizer('double'); num2hex(q,nan)
ans = 'fff8000000000000'
The leading fraction bit is 1, and all the other fraction bits are 0. Sign bit is 1, and exponent bits are all 1.
num2hex(q,inf)
ans = '7ff0000000000000'
Sign bit is 0, exponent bits are all 1, and all fraction bits are 0.
num2hex(q,-inf)
ans = 'fff0000000000000'
Sign bit is 1, exponent bits are all 1, and all fraction bits are 0.
Version History
Introduced before R2006a