From: Ashton Bradley on
I'm trying to plot multiple sets of data and am trying to
find a way to add on to the legend rather than simply
replacing it. For example:

x=[0,1,2,3,4,5,6,7,8,9,10];
y=[0,1,4,9,16,25,36,49,64,81,100];
p1=plot(x,x);
legend([p1], '1')
hold on
p2=plot(x,y);
?????

At this point I'm not sure what to do. I want a label for
p2 to be added to the legend without losing the label for
p1. I can't just add the legend at the end either because
the plotted data is selected using conditional statements
and not every data set will be plotted. Id there a way to
do this without adding additional conditional statements?