How to change element in base 10 to base 2 in a matrix, with loops and while
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Suppose i have a matrix called A,the elements ib base 10,how do i convert to base 2 .with conditions and loops.
14 Commenti
Walter Roberson
il 24 Set 2017
variable(count) = lastbit;
Yes, mod(current_num,2) is fine to extract the last bit.
Risposte (1)
Jose Marques
il 9 Set 2017
A = magic(5) %generating a matrix 5x5
A = (A<10) %suppose you want the elements in A < 10
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!