how to extract last 3 bits from binary string and then concatenate

15 vues (au cours des 30 derniers jours)
lilly lord
lilly lord le 29 Mai 2020
Commenté : lilly lord le 29 Mai 2020
Hi, i have an array which is converted into binary string. I want to extract last three bits and then arrange in an array
Y=[123 345 981 345 650]';
%Convert into binary
Y1=dec2bin(Y);
%%%%Out put is
'0001111011'
'0101011001'
'1111010101'
'0101011001'
'1010001010'

Réponse acceptée

KSSV
KSSV le 29 Mai 2020
iwant = Y1(:,8:10)
  6 commentaires
KSSV
KSSV le 29 Mai 2020
iwant = Y1(:,8:10)' ;
iwant = iwant(:)'
lilly lord
lilly lord le 29 Mai 2020
Thank u so much.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Data Type Conversion 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!

Translated by