How to separate binary values ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I try to convert String to Binary , and after that i want to get
A [0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 1 0 1 0 0 1 1 0 1 0 1 0 1 0 0];
word = 'TEST';
binary = dec2bin(word);
And we got 01010100 01000101 01010011 01010100, how i can separate all the binary value into 1 by 1 , it's only consist 0 and 1?
0 Kommentare
Akzeptierte Antwort
the cyclist
am 12 Mär. 2013
word = 'TEST';
binary = dec2bin(word)';
binary(:)-'0'
Does this do what you want? (Notice I needed to take a transpose.)
1 Kommentar
Weitere Antworten (1)
Shashank Prasanna
am 12 Mär. 2013
No direct way, but some jugglery:
A = (reshape(binary',1,7*4))-'0'
0 Kommentare
Siehe auch
Kategorien
Mehr zu Characters and Strings 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!