MATLAB Function Reference Previous page   Next Page
hex2num

Convert hexadecimal number string to double-precision number

Syntax

Description

n = hex2num(S), where S is a 16 character string representing a hexadecimal number, returns the IEEE double-precision floating-point number n that it represents. Fewer than 16 characters are padded on the right with zeros. If S is a character array, each row is interpreted as a double-precision number.

NaNs, infinities and denorms are handled correctly.

Example

returns Pi.

returns

See Also

num2hex, hex2dec, sprintf, format


Previous page  hex2dec hgexport Next page

© 1994-2005 The MathWorks, Inc.