You are on page 1of 2

clear all,clf,clc

t=0:0.001:2*pi;
cte=4/pi;
y1=cte*sin(t);
subplot(4,4,1)
plot(t,y1)
title('Fundamental')
xlabel('tiempo')
ylabel('f1')
grid
axis([-0.5 7 -1.5 1.5])

y3=cte*(1/3)*sin(3*t);
subplot(4,4,2)
plot(t,y3)
title('3ra Comp')
xlabel('tiempo')
ylabel('f3')
grid
axis([-0.5 7 -1.5 1.5])

y13=y1+y3;
subplot(4,4,3)
plot(t,y13)
title('Suma 2 comp')
xlabel('tiempo')
ylabel('f13')
grid
axis([-0.5 7 -1.5 1.5])

y=[2*pi 2*pi pi pi 0 0];


x=[0 -1 -1 1 1 0];
subplot(4,4,5)
plot(y,x,'r')
title('Funcion Original')
xlabel('tiempo')
ylabel('f(t)')
grid
axis([-0.5 7 -1.5 1.5])

y5=cte*(1/5)*sin(5*t);
subplot(4,4,6)
plot(t,y5)
title('5ta comp')
xlabel('tiempo')
ylabel('f5')
grid
axis([-0.5 7 -1.5 1.5])
y135=y1+y3+y5;
subplot(4,4,7)
plot(t,y135)
title('suma 3 comp')
xlabel('tiempo')
ylabel('f135')
grid
axis([-0.5 7 -1.5 1.5])

y7=cte*(1/7)*sin(7*t);
subplot(4,4,10)
plot(t,y7)
title('7ma comp')
xlabel('tiempo')
ylabel('f7')
grid
axis([-0.5 7 -1.5 1.5])

y1357=y1+y3+y5+y7;
subplot(4,4,11)
plot(t,y1357)
title('suma 4 comp')
xlabel('tiempo')
ylabel('f1357')
grid
axis([-0.5 7 -1.5 1.5])

y9=cte*(1/9)*sin(9*t);
subplot(4,4,14)
plot(t,y9)
title('9na comp')
xlabel('tiempo')
ylabel('f9')
grid
axis([-0.5 7 -1.5 1.5])

y13579=y1+y3+y5+y7+y9;
subplot(4,4,15)
plot(t,y13579)
title('suma 5 comp')
xlabel('tiempo')
ylabel('f13579')
grid
axis([-0.5 7 -1.5 1.5])

You might also like