selecting 2 bits from given input bit stream alternatively

1 回表示 (過去 30 日間)
Jetty Rakesh Aditya
Jetty Rakesh Aditya 2021 年 8 月 17 日
回答済み: David Hill 2021 年 8 月 17 日
say i have an array a= [1,0,0,1,1,0,0,1]
i want to make 2 arrays
b = [10,10]
c = [01,01]

採用された回答

David Hill
David Hill 2021 年 8 月 17 日
A=reshape(a,2,[])';
b=A(1:2:end,:);
c=A(2:2:end,:);%matrix form
%you could also convert to binary
A=sum(A.*[2 1],2);
b=dec2bin(A(1:2:end),2);
c=dec2bin(A(2:2:end),2);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Types についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by