Effacer les filtres
Effacer les filtres

Update Legend with varying values (variables)

3 vues (au cours des 30 derniers jours)
GettinStarted
GettinStarted le 4 Juil 2020
Commenté : GettinStarted le 4 Juil 2020
Hello Community,
let's say the variable n in a loop becomes n=1, n=2, n=3, n=4, n=5.
The results are 5 different graphs in one figure.
How can the legend be automatically adjusted to it --> curve1 -->n=1; curve2 --> n=2 etc.?
Thank you.

Réponse acceptée

madhan ravi
madhan ravi le 4 Juil 2020
legend(sprintf('curve%d', n))

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by