MATLAB: Name several curves within a loop

plotting

Hello,
I am plotting about 80 curves on the same plot.
In order to differentiate between each curve, i would like to name each curve on the plot within the for loop shown below:
for k = 1:80
[a,b]=test(a1,b1);
labels = cellstr(num2str([k]')); % not sure about this one*bold*
h=plot_curves(a, b, 'r',5);
hold on
end
Thanks,
Ash

Best Answer

You could put a text on each curve. But placing the text could be tricky with that many curves on one plot.
x = 0:.01:1;
L = floor(length(x)/2);
hold all
for ii = 1:4
plot(x,x.^ii)
text(x(L),x(L).^ii,sprintf('%i',ii))
end