a legend from a sting array

조회 수: 18 (최근 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)
  댓글 수: 1
Brecht Leenmans
Brecht Leenmans 2018년 4월 17일
The legend is in the cell array run and the plotting start from rule 71

댓글을 달려면 로그인하십시오.

카테고리

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