hex2dec
Converts hexadecimal numbers to their decimal equivalents.
Syntax
R = hex2dec(s)
Inputs
- s
- String, matrix, or cell array representing hexadecimal number(s).
Outputs
- R
- If s is a matrix or cell array, R will be a column matrix with one row for each element. Any conversions which are invalid will result in 'Nan'
Examples
Hexadecimal string to
integer:
R = hex2dec('022b')
R = 555
Hexadecimal matrix to
integers:
R = hex2dec(['000002BC'; '0000022B'; '00000001'])
R = [Matrix] 3 x 1
700
555
1