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

Community Treasure Hunt

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

Start Hunting!

Translated by