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

1 visualizzazione (ultimi 30 giorni)
dmfwlansejr
dmfwlansejr il 18 Dic 2020
Commentato: dmfwlansejr il 18 Dic 2020
a is char type

Risposte (2)

Bruno Luong
Bruno Luong il 18 Dic 2020
>> a='10101111'
a =
'10101111'
>> a-'0'
ans =
1 0 1 0 1 1 1 1

Subhadeep Koley
Subhadeep Koley il 18 Dic 2020
Modificato: Subhadeep Koley il 18 Dic 2020
charArray = '10101111';
newCharArray = double((charArray == '1'));

Categorie

Scopri di più su Data Types in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by