How to change element in base 10 to base 2 in a matrix, with loops and while
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Suppose i have a matrix called A,the elements ib base 10,how do i convert to base 2 .with conditions and loops.
14 Kommentare
Walter Roberson
am 24 Sep. 2017
variable(count) = lastbit;
Yes, mod(current_num,2) is fine to extract the last bit.
Antworten (1)
Jose Marques
am 9 Sep. 2017
A = magic(5) %generating a matrix 5x5
A = (A<10) %suppose you want the elements in A < 10
Siehe auch
Kategorien
Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!