MATLAB: Bitsrl of a hex value

hex bitsrl

I want to bit right shift logical a hex value.
AF is input hex .Then bit is 10101111 . So bitsrl by 2 should give 101011. So out hex 2B.
I tried converting to dec and binary.But,not getting correct answer.
When converted k0=k0(:) and bit shifted ,I get both A and F shifted by 2.

Best Answer

With some guessing:
In = 'AF'
a = sscanf(In, '%X');
b = bitshift(a, -2);
Out = sprintf('%X', b)