Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有一种简单的方法可以将 char 数组转换为向量?例如,我有这个
my_array = <1*64 字符>
而且全是“1010101010……”
我希望它是:
我的向量 = [1 0 1 0 1 0....]
是否有任何功能可以在我不编写任何代码的情况下实现?谢谢
str='01001011'; [str2num(str(:))]' ans = 0 1 0 0 1 0 1 1
my_vector = double(my_array - '0');