a legend from a sting array
13 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
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 Center 和 File Exchange 中查找有关 Legend 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!