Just store the desired legend handles in a variable and pass the array to legend
. In your case, it would only be one value, like so:
hold on;
plot(t, s, 'r');
h2 = plot(t, c, 'b'); % # Storing only the desired handle
plot(t, m, 'g');
hold off;
legend(h2, 'cosine'); % # Passing only the desired handle
You should get this plot:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…