% PROB1A6  Produce one plot for both parts of problem 1 on A#6.

% useful commands so figures have bolder lines and markers
set(0,'defaultlinelinewidth',2.0)
set(0,'defaultlinemarkersize',12.0)
clf  % clear the current figure

% part (a)
xxa = 0:.01:3;  % fine grid
xa = [0, 1, 2, 3];
subplot(1,2,1)
plot(xxa,cos(xxa),'r',xa,cos(xa),'b-o')
legend('y = cos(x)','y = R(x)')
title('part (a)'),  xlabel x

% part (b)
xxb = 0:.01:5;  % fine grid
xb = [0, 0.5, 1.2, 3, 5];
f = @(x) exp(-x.^2);
subplot(1,2,2)
plot(xxb,f(xxb),'r',xb,f(xb),'b-o')
legend('y = e^{-x^2}','y = R(x)')
title('part (b)'),  xlabel x
