Input as the hexadecimal number

100 ビュー (過去 30 日間)
Gopalakrishnan venkatesan
Gopalakrishnan venkatesan 2016 年 8 月 11 日
コメント済み: Hoa Lu 2021 年 11 月 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?


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
Hoa Lu 2021 年 11 月 30 日
Thanks for your tips.
BTW, how about the floating point format such as single (float32), double (float64), or CustomFloat?


その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by