Convert Hexadecimal value to signed integer
显示 更早的评论
Hi, I have a .bin file in which data is stored in hexadecimal format. I want to do the following:
1. Read the hexadecimal data from the .bin file.
2. Convert the data into signed integer. For instance, if we have FF5C in the file, I want to read it and convert it into its corresponding signed integer representation which is -164.
Could anyone please show me the code to do so. Thank you in advance.
采纳的回答
更多回答(1 个)
Ulrich Moser
2019-3-19
0 个投票
The typecast command worked very well for hex-strings. Thank you for providing this code!
类别
在 帮助中心 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!