hex2dec

Converts a string, matrix or cell array, s, representing hexadecimal number(s) to decimal equivalent(s).

Syntax

R = hex2dec(s)

Inputs

s
String, matrix or cell array representing hexadecimal number(s).
Type: string | mat | cell

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'
Type: integer | mat

Examples

Hexadecimal string to integer example:
R = hex2dec('022b')
R = 555
Hexadecimal matrix to integers example:
R = hex2dec(['000002BC'; '0000022B'; '00000001'])
R = [Matrix] 3 x 1
700
555
  1