% Script Eg3_1
% Plots the function f(x) = sin(5x) * exp(x/2) / (1 + x^2)
% on the interval [-2,3].

L = -2;  % Left endpoint
R =  3;  % Right endpoint
N = 200; % Number of sample points
x = linspace(L,R,N);

% Vector of f-evaluations
y = sin(5*x) .* exp(-x/2) ./ (1 + x.^2);

plot(x,y,[L R],[0 0],':')
title('The function f(x) = sin(5x) * exp(x/2) / (1 + x^2)','fontsize',12)
ylabel('y = f(x)','fontsize',12)
xlabel('x','fontsize',12)