a legend from a sting array

18 visualizaciones (últimos 30 días)
Brecht Leenmans
Brecht Leenmans el 17 de Abr. de 2018
Editada: jonas el 17 de Abr. de 2018
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 comentario
jonas
jonas el 17 de Abr. de 2018
Editada: jonas el 17 de Abr. de 2018
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

Iniciar sesión para comentar.

Respuestas (1)

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

Categorías

Más información sobre Legend en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by