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 CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by