The general method would be using the legend function, to which you give a vector of the plot object handles and a series of corresponding strings. For example,
figure; hold on
a1 = plot(x,y1);
M1 = "Curve 1";
a2 = plot(x,y2);
M2 = "Curve 2";
legend([a1,a2], [M1, M2]);