You are on page 1of 1

t=[0:0.

017:5];
r1=0;
r2=0;
for n=1:100
ao=0;
an=0;
bn=2/(pi*n);
p1=1;
S1=(an*cos(2*n*pi*t/p1));
S2=(bn*sin(2*n*pi*t/p1));
r1=r1+S1;
r2=r2+S2;
end
y1=ao+r1+r2;
r1=0;
r2=0;
for n=1:100
ao=0;
an=0;
bn=2/(pi*n);
p2=1/10;
S1=(an*cos(2*n*pi*t/p2));
S2=(bn*sin(2*n*pi*t/p2));
r1=r1+S1;
r2=r2+S2;
end
y2=ao+r1+r2;
r1=0;
r2=0;
for n=1:100
ao=0;
an=0;
bn=2/(pi*n);
p3=1/60;
S1=(an*cos(2*n*pi*t/p3));
S2=(bn*sin(2*n*pi*t/p3));
r1=r1+S1;
r2=r2+S2;
end
y3=ao+r1+r2;
plot(t,y1,'k',t,y2,'b',t,y3,'r')
xlabel('t')
ylabel('f(t)')
title('f(t) para a0=0, an=0, bn=2/(pi*n)')
text(0.1,-1,'T=1/10','color','b')
text(0.6,-1,'T=1/60','color','r')
text(1.1,-1,'T=1','color','k')
grid

You might also like