You are on page 1of 1

%----------------------------------------------------

%
%
% Testando plot e soma de fun��es
%
%----------------------------------------------------
%----------------------------------------------------
t = 0:0.1:36*pi;
x1 = cos(3.5*t);
x2 = sin(2*t);
x3 = 2*cos(7*t/6);
Soma = x1 + x2 + x3;
subplot(411)
plot(t, x1)
title('Sinal x_1')
grid
xlabel('t')
ylabel('x(t)')
subplot(412)
plot(t, x2)
title('Sinal x_2')
grid
xlabel('t')
ylabel('x(t)')
subplot(413)
plot(t, x3)
title('Sinal x_3')
grid
xlabel('t')
ylabel('x(t)')
subplot(414)
plot(t, Soma)
yy = -5:0.1:5;
Tam = length(yy);
xx1 = 12*pi;
xx2 = 24*pi;
xx3 = 36*pi;
hold on
plot(xx1, yy, 'r')
plot(xx2, yy, 'r')
plot(xx3, yy, 'r')
title('Sinal x_1 + x_2 + x_3')
grid
xlabel('t')
ylabel('x(t)')
print Exemplo1.png -dpng
%----------------------------------------------------

You might also like