function D=square_wave(w,k)

x=1:pi/10:100;
D=zeros(size(x));

for n=1:2:k,
    I=(1/n)*sin(n*w*x);
    D=D+I;
end

plot(D)
