Update Legend with varying values (variables)

1 回表示 (過去 30 日間)
GettinStarted
GettinStarted 2020 年 7 月 4 日
コメント済み: GettinStarted 2020 年 7 月 4 日
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))
  1 件のコメント
GettinStarted
GettinStarted 2020 年 7 月 4 日
thanks again!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLegend についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by