Bit Concatenate

if r=[0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0];
then I wnat
r=0001001001001000 or '0001001001001000'

1 Comment

r = [0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0];
%
two = 2.^(15:-1:0)';
out = dec2bin(r * two, 16)
out = '0001001001001000'

Sign in to comment.

Answers (0)

Asked:

on 13 Aug 2021

Commented:

on 30 Dec 2021

Community Treasure Hunt

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

Start Hunting!