% script per disegnare i grafici della funzione
% 
% f( x, k ) = exp(-x) * cos( k*x )
%
% in un'unica finestra grafica, con k = 1 : 6
% usando una sottofinestra per ogni k.
%

clear

x = linspace( -pi, pi, 101);

figure
clf


f1 = exp( -x)  .*  cos( x );

subplot( 2, 3, 1)
plot( x, f1, 'r-')
xlabel('\it x')
ylabel('\it f(x)', 'Rotation', 0, 'Position', [-4 0 0])
title('\it k = 1 ')
grid on


f2 = exp( -x)  .*  cos( 2*x );

subplot( 2, 3, 2)
plot( x, f2, 'm-')
xlabel('\it x')
ylabel('\it f(x)', 'Rotation', 0, 'Position', [-4 0 0])
title('\it k = 2 ')
grid on

f3 = exp( -x)  .*  cos( 3*x );

subplot( 2, 3, 3)
plot( x, f3, 'y-')
xlabel('\it x')
ylabel('\it f(x)', 'Rotation', 0, 'Position', [-4 0 0])
title('\it k = 3 ')
grid on

f4 = exp( -x)  .*  cos( 4*x );

subplot( 2, 3, 4)
plot( x, f4, 'g-')
xlabel('\it x')
ylabel('\it f(x)', 'Rotation', 0, 'Position', [-4 0 0])
title('\it k = 4 ')
grid on

f5 = exp( -x)  .*  cos( 5*x );

subplot( 2, 3, 5)
plot( x, f5, 'b-')
xlabel('\it x')
ylabel('\it f(x)', 'Rotation', 0, 'Position', [-4 0 0])
title('\it k = 5 ')
grid on

f6 = exp( -x)  .*  cos( 6*x );

subplot( 2, 3, 6)
plot( x, f6, 'k-')
xlabel('\it x')
ylabel('\it f(x)', 'Rotation', 0, 'Position', [-4 0 0])
title('\it k = 6 ')
grid on


