How to a='10101111' convert array b=[1,0,1,0,1,1,1,1]

1 回表示 (過去 30 日間)
dmfwlansejr
dmfwlansejr 2020 年 12 月 18 日
コメント済み: dmfwlansejr 2020 年 12 月 18 日
a is char type

回答 (2 件)

Bruno Luong
Bruno Luong 2020 年 12 月 18 日
>> a='10101111'
a =
'10101111'
>> a-'0'
ans =
1 0 1 0 1 1 1 1

Subhadeep Koley
Subhadeep Koley 2020 年 12 月 18 日
編集済み: Subhadeep Koley 2020 年 12 月 18 日
charArray = '10101111';
newCharArray = double((charArray == '1'));

カテゴリ

Help Center および File ExchangeData Types についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by