Update Legend with varying values (variables)

3 次查看(过去 30 天)
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.

采纳的回答

madhan ravi
madhan ravi 2020-7-4
legend(sprintf('curve%d', n))

更多回答(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