name several curves within a loop
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
I am plotting about 80 curves on the same plot.
In order to differentiate between each curve, i would like to name each curve on the plot within the for loop shown below:
for k = 1:80
[a,b]=test(a1,b1);
labels = cellstr(num2str([k]')); % not sure about this one*bold*
h=plot_curves(a, b, 'r',5);
hold on
end
Thanks,
Ash
0 commentaires
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 4 Sep 2012
labels{k} = num2str(k);
Then at the end of the loop,
legend(labels)
This assumes that plot_curves is constructing exactly one line object per loop iteration.
0 commentaires
Voir également
Catégories
En savoir plus sur Fit Postprocessing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!