MATLAB Answers

0

Input as the hexadecimal number

Latest activity Edited by Guillaume
on 11 Aug 2016
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 Comments

Sign in to comment.

1 Answer

Answer by Guillaume
on 11 Aug 2016
Edited by Guillaume
on 11 Aug 2016
 Accepted Answer

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)

  0 Comments

Sign in to comment.