How to separate binary values ?
8 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
the cyclist
2013-3-12
word = 'TEST';
binary = dec2bin(word)';
binary(:)-'0'
Does this do what you want? (Notice I needed to take a transpose.)
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!