% Plot a function two different ways:
%   - one point at a time
%   - using vectors of x and y values

close all

figure  % figure 1
hold on
% Plot one point at a time
for x=  -2:.01:3
    y= sin(5*x)*exp(-x/2)/(1+x^2);
    plot(x,y,'.')
end
hold off

figure  % figure 2
% Plot using VECTORS of x and y values
a= linspace(-2,3,501);
b= sin(5*a).*exp(-a/2)./(1+a.^2);
% a and b are computed with vectorized arithmetic operations
plot(a,b,'.')


    