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]
文字列は文字の配列なので、
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