How can I convert an array of hex values to a num?
7 views (last 30 days)
Show older comments
Alejandro Jimenez
on 15 Dec 2018
Answered: Alejandro Jimenez
on 15 Dec 2018
I have an array with '30' '2E' '30' '31' for example, it is a part of a xbee frame, so I would like to get the value (0.01) and I do not know how... Maybe hex2num? But i dont knoe how to insert the values on it.
I know how to do the oposite operation:
>>dec2hex('0.01')
4×2 char array
'30'
'2E'
'30'
'31'
Please help, I'm trying everything...
0 Comments
Accepted Answer
Bruno Luong
on 15 Dec 2018
>> xa=dec2hex('0.01')
xa =
4×2 char array
'30'
'2E'
'30'
'31'
>> a=str2double(char(hex2dec(xa))')
a =
0.0100
>>
0 Comments
More Answers (1)
See Also
Categories
Find more on Data Type Conversion in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!