% Fourier Demo using a for loop
% By Minas Spetsakis
X=[0:100]*2*pi/100; % or
X=linspace(0,2*pi,300);
C=['r';'g';'b';'k';'m';'c';'y';'r';'g';'b';'k';'c';'m';'y'];
Y=0;
for i=1:4
    k=2*i-1;
    Y=Y+sin(k*X)/k;
    plot(X,Y,C(i));
    hold on;
end;

hold off;
