MATLAB: Matlab Legend

legendMATLABplotplotting

So in my plot I have numerous different programs being plotted however a certain program is being plotted in blue while all the other programs are being plotted in grey. Currently, my legend is the following:
legend(highlight,name,'Location','EastOutside');
where highlight is a vector containing all the blue lines,name is a cell that contains the label for each of the blue lines.
What I'm trying to do is in addition to showing this, I would like my legend to show one grey line with the label 'Other Programs' even though there are numerous grey lines being plotted.
Now what I was thinking of doing was the following:
legend([highlight otherprograms(1)],name,'Other Programs','Location','EastOutside');
but it has failed.
Can anyone help me accomplish this?

Best Answer

plot(magic(10),'b');
Name=strcat('L',cellstr(num2str((1:10)')));
hold on;
plot(magic(3),'r');
h=legend([Name;'other red']);
Related Question