a legend from a sting array

13 次查看(过去 30 天)
Brecht Leenmans
Brecht Leenmans 2018-4-17
编辑: jonas 2018-4-17
I have a string array with a unknown number of cells in a row. How can I make a legend of them? Every 2D line one cell.
  1 个评论
jonas
jonas 2018-4-17
编辑:jonas 2018-4-17
could you provide some code or an example to work with?
EDIT: I ran the code but still don't know what results you are looking for. If you cannot figure it out based on KSSVs answer, then you need to provide more details, e.g. a simple example

请先登录,再进行评论。

回答(1 个)

KSSV
KSSV 2018-4-17
str{1} = 'one' ;
str{2} = 'two' ;
str{3} = 'three' ;
figure
hold on
for i = 1:3
    plot(rand(10,1)) ;
end
legend(str)

类别

Help CenterFile Exchange 中查找有关 Legend 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by