As,
d = (1:5);
b = de2bi(d,4,'left-msb'); will give us...
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 0 1
But, I need the output to be like this:
b = 00010010001101000101 i.e. in the form of bit-stream.
How can I achieve this?

 채택된 답변

James Tursa
James Tursa 2019년 6월 20일

1 개 추천

E.g.,
bstream = reshape(b',1,[]);
If you want characters, then
bstream = char(reshape(b',1,[]) + '0');

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Types에 대해 자세히 알아보기

질문:

2019년 6월 20일

답변:

2019년 6월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by