First I enter a string and convert it to binary using hex2dec and dec2bin.
But I can't shift using bitshift because of error must be numeric.
I can't shift with dec also.It gives altogether a different answer.
I want to right logical shift, 92f09952c625e3e9 by 1 and should get
49784ca96312f1f4.
Can anyone please help me?

 Respuesta aceptada

Walter Roberson
Walter Roberson el 24 de En. de 2018

0 votos

S = '92f09952c625e3e9';
sprintf('%lx', bitshift(sscanf(, '%lx'), -1) )

1 comentario

Adarsh Santhosh
Adarsh Santhosh el 24 de En. de 2018

Got it thank you very much.

S was missing.Did u do that on purpose?
Coz someone did that to me before too.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Characters and Strings en Centro de ayuda y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by