Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

1.

1
clc
%EJERCICIO 1.1 LITERAL 2%
a=[-3 -2 -2 -1 -1 0 1 1 2 2 3]
b=[0 0 1 1 2 2 2 1 1 0 0]
subplot(2,3,1),plot(a,b,'r'),title('grafico Nº1')
ylabel('x(t)')
xlabel('t')
c=[-5 -4 -1 1 4 5]
d=[0 0 1 1 0 0]
subplot(2,3,2),plot(c,d,'b'),title('grafico Nº2')
xlabel('t')
ylabel('x(t)')
e=[ -6 -6 -3 -3 0 3 3 6 6 ]
f=[0 2 2 4 6 4 2 2 0]
subplot(2,3,3),plot(e,f,'g'),title('grafico Nº3')
xlabel('t')
ylabel('x(t)')
g=[ -2 -2 0 2 2 ]
h=[0 4 2 4 0]
subplot(2,3,4),plot(g,h,'m'),title('grafico Nº4')
xlabel('t')
ylabel('x(t)')
i=[-1 0 0 1 1 2 2 3 3 4 4 5 5 6]
j=[0 0 1 1 0 0 1 1 0 0 1 1 0 0]
subplot(2,3,5),plot(i,j,'y'),title('grafico Nº5')
xlabel('t')
ylabel('x(t)')

1.3
clc
%ESCALON UNITARIO%
t=-1:0.01:5;
y=heaviside(t);
subplot(3,3,1),plot(t,y),title('a) Escalón unitario')
xlabel('t')
ylabel('u(t)')
axis([-4 6 -3 5])
grid on
%RAMPA UNITARIA%
t=-1:5
subplot(3,3,2),stem(t,t,'r'),plot(t,t,'k'),title('b) Función rampa
unitaria')
xlabel('t')
ylabel('r(t)')
axis([-4 10 -3 10])
grid on
%GRAFICA C%
t=-1:0.01:5;
f=((0<=t)&(t<=2)).*(1)+((t>2)&(t<0)).*(0);
subplot(3,3,3),plot(t,f),title('c) Función a trozos')
axis([-3 7 -2 2])
xlabel('t');
ylabel('x(t)');
grid on
%GRAFICA D%
syms t
subplot(3,3,4),ezplot(heaviside(t)*exp(-3*t)*10, [-1, 5]),title('d)
10e^{-3t}u(t)')
axis([-10 10 -10 20])
ylabel('x(t)')
grid on
%GRAFICA E%
syms t
subplot(3,3,5),ezplot(heaviside(t)*exp(-t)*3*cos(2*t),[-1,
5]),title('e) 3e^{-t}cos(2t)')
axis([-10 10 -10 10])
ylabel('x(t)')
grid on
%GRAFICA F%
syms t
subplot(3,3,6),ezplot(heaviside(t)*exp(t)*3*cos(2*t), [-1,
5]),title('f) 3e^{t}cos(2t)')
axis([-10 20 -500 200])
ylabel('x(t)')
grid on
%GRAFICA G%
syms t
subplot(3,3,7),ezplot(2*sin(3*t-pi/2)-cos(2*t), [-1, 5]),title('g)
2sin(3t-pi/2)-cos(2t)')
axis([-5 10 -10 10])
ylabel('x(t)')
grid on
%GRAFICA H%
syms t
subplot(3,3,8),ezplot(sin(5*t)+sin(pi*t),[-1, 5]),title('h) sin(5t)
+sen(pi*t)')
axis([-5 8 -10 8])
ylabel('x(t)')
grid on

1.7
clc
%EJERCICIO A%
n=-10:10
unitario=n>=0;
subplot(3,3,1),stem(n,unitario),title('a) Escalón unitario');
xlabel('n');
ylabel('x[n]');
axis([-4 4 -3 2])
%EJERCICIO B%
n=-1:20;
ramp_n=(n>=0).*n;
subplot(3,3,2),stem(n,ramp_n),title('b) Rampa unitaria')
axis([-10 10 -10 20])
xlabel('n');
ylabel('x[n]');
grid on
%EJERCICIO C%
n=-10:10
unitario=n>=0;
x=power(0.5,n).*unitario
subplot(3,3,3),stem(n,x),title('c) 0.5^{n}u[n]')
xlabel('n');
ylabel('x[n]');
grid on
%EJERCICIO D%
n=-10:10
unitario=n>=0;
x=power(-0.5,n).*unitario
subplot(3,3,4),stem(n,x),title('d) -0.5^{n}u[n]')
xlabel('n');
ylabel('x[n]');
grid on
%EJERCICIO E%
n=-10:10
unitario=n>=0;
x=power(2,n).*unitario
subplot(3,3,5),stem(n,x),title('e) 2^{n}u[n]')
xlabel('n');
ylabel('x[n]');
grid on

%EJERCICIO F%
n=0:1:40;
x=sin(pi*n/4);
subplot(3,3,6),stem(n,x),title('f) sin(pi*n/4)')
axis([0 10 -2 2])
xlabel('n');
ylabel('x[n]');
grid on
%EJERCICIO G%
n=0:1:40;
x=sin(pi*n/2);
subplot(3,3,7),stem(n,x),title('g) sin(pi*n/2)')
axis([0 10 -2 2])
xlabel('n');
ylabel('x[n]');
grid on
%EJERCICIO H%
n1=0:1:40;
x=power(0.9,n).*(sin(pi*n/4)+cos(pi*n/4));
subplot(3,3,8),stem(n1,x),title('h) 0.9^{n}[sin(pi*n/4)+cos(pi*n/4)]')
axis([0 20 -5 5])
xlabel('n');
ylabel('x[n]');
grid on
%EJERCICIO I%
n=-5:1:5;
f=((-4<=n)&(n<=4)).*(1)+((n>4)&(n<-4)).*(0);
subplot(3,3,9),stem(n,f),title('I) Función a trozos');
axis([-7 7 -2 2])
xlabel('n');
ylabel('x[n]');
grid on

You might also like