%% Add a Legend
% Create a vector of logarithmically spaced x-coordinates and two vectors of y-coordinates. Then plot two lines by passing comma-separated x-y pairs to semilogx. Display a legend by calling the legend function.

x = logspace(1,4,100);
v = linspace(-50,50,100);
y1 = 100*exp(-1*((v+5).^2)./200);
y2 = 100*exp(-1*(v.^2)./200);
semilogx(x,y1,x,y2,'--')
legend('Measured','Estimated')
grid on

% Copyright 2020 The MathWorks, Inc.