gistlib
You can add labels to the legend in MATLAB by specifying them in the legend function. Here's an example:
legend
main.mx = 1:10; y1 = x; y2 = x.^2; plot(x, y1, 'r', x, y2, 'b'); legend('y = x', 'y = x^2'); 88 chars7 lines
x = 1:10; y1 = x; y2 = x.^2; plot(x, y1, 'r', x, y2, 'b'); legend('y = x', 'y = x^2');
In this example, the legend function adds labels 'y = x' and 'y = x^2' to each respective plot.
gistlibby LogSnag