How to change element in base 10 to base 2 in a matrix, with loops and while
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Suppose i have a matrix called A,the elements ib base 10,how do i convert to base 2 .with conditions and loops.
14 commentaires
Walter Roberson
le 24 Sep 2017
variable(count) = lastbit;
Yes, mod(current_num,2) is fine to extract the last bit.
Réponses (1)
Jose Marques
le 9 Sep 2017
A = magic(5) %generating a matrix 5x5
A = (A<10) %suppose you want the elements in A < 10
Voir également
Catégories
En savoir plus sur Matrices and Arrays 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!
