%% Add Legend to Graph
% Create a graph of sine and cosine. Add a legend to the graph indicating
% the two functions.

% Copyright 2015 The MathWorks, Inc.


x = -pi:pi/20:pi;
y1 = sin(x);
y2 = cos(x);

figure
plot(x,y1,'-ro',x,y2,'-.b')
legend('sin(x)','cos(x)')
