MATLAB Answers

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

32 views (last 30 days)
sadasd asasdas
sadasd asasdas on 18 Dec 2020
Commented: sadasd asasdas on 18 Dec 2020
a is char type

  0 Comments

Sign in to comment.

Answers (2)


Subhadeep Koley
Subhadeep Koley on 18 Dec 2020
Edited: Subhadeep Koley on 18 Dec 2020
charArray = '10101111';
newCharArray = double((charArray == '1'));

  0 Comments

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!