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.
我有一个包含字符串和值的列的大单元格数组 (m)。
有谁知道如何在循环中使用字符串?例如:如果它们是数字,我会这样做
for i = 1:100 plot m(:,i) end
有没有任何形式可以使用字符串像这样工作?我有 74 个不同的字符串(这就是我想使用循环的原因)!
要使用元胞数组中的元素,请使用花括号 {} 检索存储在每个元胞索引处的数据,如以下循环所示:
for i = 1:74 str = m{i}; % do something with string end