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.
我有一个整数列表
[0, 10, 20, 30, ...]
我想用它们作为情节中的传奇。我的理解是我需要发出命令
legend('0','10','20','30', ...)
那么如何从原始向量中获取要传递给的字符串列表legend()?
legend()
num2str对我不起作用,因为我只得到一根长字符串。我对 MATLAB 语法还是有点陌生...
num2str
legend(num2str([0, 10, 20, 30]'))
转换数字的列向量将产生一个具有 m 行的 char 数组,其中每一行都可以是一个图例条目。