how can we add spaces in a numeric string and then change into vector form? i.e changing 11100100 into [1 1 1 0 0 1 0 0]

1 回表示 (過去 30 日間)
how to change string 11100100 into [1 1 1 0 0 1 0 0 ]

採用された回答

Jos (10584)
Jos (10584) 2017 年 10 月 26 日
This is a neat trick for such a conversion:
s = '0111001010'
v = s - '0'

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by