MATLAB: 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]

string to array coversion with spaces

how to change string 11100100 into [1 1 1 0 0 1 0 0 ]

Best Answer

This is a neat trick for such a conversion:
s = '0111001010'
v = s - '0'