Skip to content

hex2num

builtin · libnexusinterp/corefcn/hex2num-proprietary.cc

: n = hex2num (s)
: n = hex2num (s, class)

Decode hexadecimal strings into the numbers whose storage they describe.

Each string lists, most significant digit first, the bits of one value of type class (default "double"). The supported classes are "double", "single", "int8", "int16", "int32", "int64", "uint8", "uint16", "uint32", "uint64" and "char"; they use 16, 8, 2, 4, 8, 16, 2, 4, 8, 16 and 2 digits respectively. A string with fewer digits is completed with zeros on its right, so that hex2num ("4") is 2. Upper and lower case digits are equivalent, other characters are rejected.

The input s is a character matrix with one string per row, which gives a column of numbers, or a cell array of strings, which gives an array of the same shape as the cell.