Input as the hexadecimal number
31 次查看(过去 30 天)
显示 更早的评论
Is it possible to enter directly the hexadecimal number without the conversion to decimal number and perform all the hexadecimal operation like AND,OR, XOR?
For example a = 0x53656174 , b = 0x454B5350
c = bitand(a,b)
how to represent the hexadecimal number in matlab?
0 个评论
采纳的回答
Guillaume
2016-8-11
编辑:Guillaume
2016-8-11
Unfortunately, there is no support for hexadecimal literals. The best you can do is:
a = hex2dec('3656174');
b = hex2dec('454B5350');
However, there is support for displaying in hexadecimal:
format hex
c = bitand(a, b)
1 个评论
Hoa Lu
2021-11-30
Thanks for your tips.
BTW, how about the floating point format such as single (float32), double (float64), or CustomFloat?
更多回答(1 个)
Stephen23
2022-4-26
Since R2019b it is possible to directly enter literal hexadecimal and binary numeric values:
0x2A
0b101010
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!