How do I use a string for the argument in legend()?
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Anthony Mittas
am 22 Jul. 2015
Beantwortet: Star Strider
am 22 Jul. 2015
I have created this string: legend_string = ['g-Switch High', 'g-Switch Low']; I would like to use it like this: legend(legend_string) to plot 2 legend lines (blue line - g-Switch High, red line - g-Switch Low). What I get is one legend line with 'g-Switch High', 'g-Switch Low' as the display.
0 Kommentare
Akzeptierte Antwort
Star Strider
am 22 Jul. 2015
The square brackets [] concatenate character arrays. Making a cell array out of them will display them as you want them:
legend_string = {'g-Switch High', 'g-Switch Low'};
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Legend finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!