MATLAB: Legend on a plot.

legend

Hi All, I Plot a 250×10 matrix. But I only want the legend for the 3rd 5th and 9th element.
How can I do this?

Best Answer

Use the handle explicitly:
h = plot(cumsum(rand(250,10)));
legend(h([3 5 9]),'third','fifth','ninth')
And for more info:
doc legend
Related Question