legend

5 views (last 30 days)
Bahareh
Bahareh on 22 Oct 2011
I have a matrix m which varies with vectors a and b. I've plotted m versus a for different values of b, but I don't know how to set the legend command corresponding different values for b. I will be so grateful if somebody can help me.

Accepted Answer

Mitch Martelli
Mitch Martelli on 22 Oct 2011
Try
  • if b is a numerical vector with:
legend(num2str(b(:)))
  • If b is a string vector :
legend(b)
  2 Comments
Jan
Jan on 22 Oct 2011
What is a "string vector"?
Mitch Martelli
Mitch Martelli on 23 Oct 2011
I cant write english very well... I'm sorry...I dont find an other way to explain what I think...

Sign in to comment.

More Answers (0)

Categories

Find more on Labels and Annotations in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!