Is it possible to insert in a legend a calculated variable?
Ältere Kommentare anzeigen
Hey everybody,
ts me again with an maybe simple question for you. I have a for loop and calculate some data, which I plot at the end of each loop. Is it possible to define, that the legend will have an calculated data in it? Such as loop one z=1, loop two z=2.5 and so on.
Thanks in advance for some help
Akzeptierte Antwort
Weitere Antworten (1)
Dishant Arora
am 8 Apr. 2014
str = {strcat('z = ' , num2str(z))} % at the end of first loop, z being loop output
str = [str , strcat('z = ' , num2str(z))] % after 2nd loop
% plot your data
legend(str{:})
1 Kommentar
ramez sabra
am 8 Jul. 2021
Thank you
Kategorien
Mehr zu Legend finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!