How can I add both numbers and text as legend in a plot?

220 次查看(过去 30 天)
I have a matrix called x, which contains 8 numbers. I have then a plot, and I can get the numbers as legend by writing legend(num2str(x(1)),.....), but I also want one letter after each number in the legend. Have tried to write legend(num2str(x(1)) 'V',.....) etc. but with no success. Have searched a while after a solution, but can't find any.

采纳的回答

sixwwwwww
sixwwwwww 2013-12-4
use
legend(strcat('Some text', num2str(someValue)))

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