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.
再会!a=[letters]例如,如果我输入并且我想要的输出是,我该如何制作一个字母数组b= [ l e t t e r s]?我想在某些功能中使用每个字符。任何帮助将不胜感激。
a=[letters]
b= [ l e t t e r s]
String 是一个字母数组,所以
b = 'test'
是一样的
b = ['t', 'e', 's', 't']
MatLab 中的字符串是功能齐全的数组。自由使用它们。
是的,您可以以正常方式循环遍历字符串:
b = 'test'; for t = 1:length(b); fprintf('%dth one is %s\n',t,b(t)); end