% demonstration of the subplot function

figure;
x = linspace(-pi, pi, 400);
subplot(2, 2, 1);
plot(x, tan(x));
title('Plot of tan(x)');
xlabel('x');
ylabel('tan(x)');
axis([-pi, pi, min(tan(x)), max(tan(x))]);

x = linspace(-100, 100);
subplot(2, 2, 2);
plot(x, atan(x));
title('Plot of atan(x)');
xlabel('x');
ylabel('atan(x)');



% Plot |F(w)| and argF(w) for w in the interval [-4, 4].
% F(w) = sin(w)*exp(j*w)

w = linspace(-4, 4);
Fw = sin(w).*exp(j*w);
subplot(2, 2, 3);
plot( w, abs(Fw) );
title('Plot of |F(\omega)|');
xlabel('\omega');
ylabel('|F(\omega)|');

subplot(2, 2, 4);
plot( w, angle(Fw) );
title('Plot of argF(\omega)');
xlabel('\omega');
ylabel('argF(\omega)');

