Vous êtes sur la page 1sur 5

# Dibujar las siguientes seales usando Matlab:

a.
b.
c.
d.

1() = () + 5( 1) 2( 2)
2() = () ( 1) ( 2)
3() = (cos())
4() = 2() + (t 1)

%
Los siguiente cdigos nos permiten obtener las 4 graficas de las
seales
clear all
f=-1:0.01:9; % eje auxiliar para graficar
t=-0.5:0.01:5;
%********************* procedimiento para x1(t) **********************
subplot( 2, 2, 1);
x1=(t<=0).*0 + ((t>0)&(t<1)).*1 +
((t>=1)&(t<=2)).*(6)+((t>2)&(t<=4)).*4;
plot (t, x1,'-','LineWidth',2)
axis ([-0.2 4 -0.5 6.5])
hold on
plot (f, 0,'-k');
plot (0,f,'-k');
title('x1(t)= u(t) + 5u(t-1) - 2u(t-2)');
%********************* procedimiento para x2(t) **********************
subplot (2, 2, 2);
x2=(t<=0).*0 + ((t>0)&(t<1)).*t +
((t>=1)&(t<=2)).*(1)+((t>2)&(t<=4)).*0;
plot (t, x2,'-','LineWidth',2)
axis ([-0.2 4 -0.1 1.5])
hold on
plot (f, 0,'-k');
plot (0,f,'-k');
title ('x2(t)= r(t) - r(t-1) - u(t-2)')
%********************* procedimiento para x3(t) **********************
t=-pi/2:0.01:3*pi;
subplot (2, 2, 3);
x3=(t<=pi/2).*1 + ((t>(pi/2))&(t<(3*pi/2))).*(0) +
((t>=(3*pi/2))&(t<=(5*pi/2))).*1 + (t>(5*pi/2)).*0;
plot (t, x3,'-','LineWidth',2)
axis ([-0.5 3*pi -0.1 1.5])
hold on
plot (f, 0,'-k');
plot (0,f,'-k');
title ('x3(t)= u(cos(t))')
%********************* procedimiento para x4(t) **********************
t=-0.5:0.01:4;
subplot( 2, 2, 4);
x4=(t<0).*0 + (t>=0).*2;
plot (t, x4,'-','LineWidth',2)
hold on
stem(1,1,'LineWidth',2)
axis ([-0.2 4 -0.18 2.5])
hold on
plot (f, 0,'-k');
plot (0,f,'-k');
title('x4(t)= 2u(t) + (t-1)')
hold off

Graficas

## Usando Matlab grafique las siguientes seales:

clc
close all
clear all
t=-10:0.01:10;
f=(t+1).*heaviside(t+1)-(t).*heaviside(t)-heaviside(t-2);
%********************* grafica x(t) **********************
subplot( 2, 2, 1);
plot (t, f,'-','LineWidth',2)
axis ([-5.2 4.2 -0.5 1.5])
grid
hold on
title('x(t)');

## %********************* grafica x(-t) **********************

subplot (2, 2, 2);
plot (-t, f,'-','LineWidth',2)
axis ([-5.2 4.2 -0.5 1.5])
grid
hold on
title ('x(-t)')
%********************* grafica x(3-t) *********************
subplot (2, 2, 3);
plot (3-t, f,'-','LineWidth',2)
axis ([-5.2 4.2 -0.5 1.5])
grid
hold on
title ('x(3-t)')
%********************* grafica x(-t-3) *********************
subplot( 2, 2, 4);
plot (-t-3, f,'-','LineWidth',2)
axis ([-5.2 4.2 -0.5 1.5])
grid
hold on
title('x(-t-3)')
hold off