How to divide 8 bit binary into two 4 bit?

25 views (last 30 days)
sami ullah
sami ullah on 24 Oct 2020
Commented: sami ullah on 25 Oct 2020
For example A=11001111,
i want to break it as A1=1100 and A2=1111.
How it can be done in matlab?

Accepted Answer

madhan ravi
madhan ravi on 24 Oct 2020
A = '11001111'
A = mat2cell(A, 1, [4, 4]);
celldisp(A)
  3 Comments
sami ullah
sami ullah on 25 Oct 2020
I did it as:
N=12;
A=dec2bin(A,8)
A=mat2cell(A, 1, [4, 4]);
celldisp(A)
And it is done
Thanks

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!

Translated by