num2hex
Convert single- and double-precision numbers to IEEE hexadecimal format
Syntax
Description
hexStr = num2hex( returns a representation
of X)X in IEEE® format using hexadecimal digits.
If
Xis a double-precision number, thenhexStrhas 16 characters.If
Xis a single-precision number, thenhexStrhas 8 characters.If
Xis a vector, matrix, or multidimensional array, thenhexStris a two-dimensional character array. Each row ofhexStrrepresents an element ofX.
Unlike the dec2hex function, num2hex can
convert floating-point values with fractional parts. Also, num2hex
handles NaN and Inf values and denormal numbers
correctly.
The format produced by num2hex is identical to the one produced by
the format hex command.
Examples
Input Arguments
Extended Capabilities
Version History
Introduced before R2006a