Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

num2hex

Convert singles and doubles to IEEE hexadecimal strings

Syntax

num2hex(X)

Description

If X is a single or double precision array with n elements, then num2hex(X) is an n-by-8 or n-by-16 character array in which each row contains the hexadecimal floating-point representation of a number. The same representation is printed with format hex.

Examples

num2hex([1 0 0.1 -pi Inf NaN])

returns

ans =

3ff0000000000000
0000000000000000
3fb999999999999a
c00921fb54442d18
7ff0000000000000
fff8000000000000
num2hex(single([1 0 0.1 -pi Inf NaN]))

returns

ans =

3f800000
00000000
3dcccccd
c0490fdb
7f800000
ffc00000

See Also

| |

Introduced before R2006a

Was this topic helpful?