Legend of Many curves on one graph?!
    3 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
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
0 Commenti
Risposta accettata
  KSSV
      
      
 il 12 Giu 2017
        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 Commenti
Più risposte (0)
Vedere anche
Categorie
				Scopri di più su Legend in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

