필터 지우기
필터 지우기

Legend of Many curves on one graph?!

조회 수: 1 (최근 30일)
Ano
Ano 2017년 6월 12일
답변: KSSV 2017년 6월 12일
Hello, I would like to have a legend that is on a for-loop so for each entry I would like to have a name of my data , how can I do it ? I have tried the following line but it doesn't work!
for i=1:5
load all my file .*mat
do some calculations
plot(data)
legend (num2str(i))
hold on
end

채택된 답변

KSSV
KSSV 2017년 6월 12일
N = 5 ;
str = cell(N,1) ;
for i=1:N
% load all my file .*mat
% do some calculations
plot(rand(10,1))
str{i} = num2str(i) ;
hold on
end
legend(str)

추가 답변 (0개)

카테고리

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