Contents Previous Next Subchapters

Conversion From Hexadecimal to Decimal
Syntax hex2dec(hex)
See Also dec2hex , atoi , atod

Description
Converts the hexadecimal representation hex to decimal integer where hex is a character matrix. The return value is an integer row vector in which the i-th element contains the decimal representation of the i-th row of hex

In hexadecimal representation that valid characters are the decimal digits 0 through 9 and the letters a through f (the letters A through F can also be used). The letters represent the values 10 though 15 in alphabetic order.

Example
If you enter
     hex2dec({ "09", "19", "0a", "1A" })
O-Matrix will respond
     {
     9
     27
     10
     26
     }

Reference
White space characters are not valid hexadecimal digits. You must use 0 for the value zero.