selecting 2 bits from given input bit stream alternatively
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Jetty Rakesh Aditya
le 17 Août 2021
Réponse apportée : David Hill
le 17 Août 2021
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]
0 commentaires
Réponse acceptée
David Hill
le 17 Août 2021
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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Types dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!