Is there a command for/how to convert a binary number to binary vector?

4 次查看(过去 30 天)
Hi,
I got a binary number and i want to convert it to a binary vector like;
a=101010101010101010 to [1 0 1 0 1 0 1 0 ....]

采纳的回答

Oleg Komarov
Oleg Komarov 2012-8-3
a = '101010101010101010';
a = a - '0';

更多回答(1 个)

Azzi Abdelmalek
Azzi Abdelmalek 2012-8-3
b=num2str(a);c=b(:);
result=str2num(c)'

类别

Help CenterFile Exchange 中查找有关 Data Type Conversion 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by