Manipulate binary element in matrix
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
zahrein yaacob
le 6 Juil 2019
Commenté : zahrein yaacob
le 9 Juil 2019
Hi If i have binary digits in the element.How do i choose element bit 5 to bit 8.
A= 010101010
This A is in binary format.
0 commentaires
Réponse acceptée
KALYAN ACHARJYA
le 6 Juil 2019
Modifié(e) : KALYAN ACHARJYA
le 6 Juil 2019
bin_num=str2num(A);
bin_array=num2str(bin_num)-'0';
bits_selection=bin_array(5:8)
or
bin_data=A-'0'
bits_selection=bin_data(5:8)
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Types dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!