%% Add a Legend
% Create two sets of x- and y-coordinates and display them in a log-linear plot. Specify a dashed line for the first set of coordinates. Then display a legend in the upper left corner of the plot by calling the legend function and specifying the location as 'northwest'.

x = 1:100;
y1 = x.^2;
y2 = x.^3;
semilogy(x,y1,'--',x,y2)
legend('x^2','x^3','Location','northwest')

% Copyright 2020 The MathWorks, Inc.