MATLAB Answers

Update Legend with varying values (variables) part2

1 ビュー (過去 30 日間)
GettinStarted
GettinStarted 2020 年 7 月 4 日
回答済み: Nikhil Sonavane 2020 年 7 月 14 日
Hello,
I have a hard time to figure this configuration out. This time a little bit more precise:
Legend should look like this
Tricky?

  2 件のコメント

Walter Roberson
Walter Roberson 2020 年 7 月 4 日
Your legend(sprintf('curve%d',n)) does not appear to be within the loop?
And if it is, then so is the legend('unit cell')
GettinStarted
GettinStarted 2020 年 7 月 5 日
Hi Walter,
thanks for the answer.
The legends should correspond to:
The yellow marked ones do appear an the loop.
My goal is to achieve a legend like this.

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

採用された回答

Nikhil Sonavane
Nikhil Sonavane 2020 年 7 月 14 日
As Walter suggested, your legend command should be in a loop to recurrsively update the legend in your figure. Variable Tpc_22 appears in the loop but only its last value is considered by the legend command while including legend in your figure. I would suggest you to use the legend command in the loop as well.

  0 件のコメント

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by