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?

 채택된 답변

Walter Roberson
Walter Roberson 2018년 1월 24일

0 개 추천

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

댓글 수: 1

Adarsh Santhosh
Adarsh Santhosh 2018년 1월 24일

Got it thank you very much.

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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by