The Fourier series expansion for a square-wave is made up of a sum of odd harmonics. We show this graphically using MATLAB®.
We start by forming a time vector running from 0 to 10 in steps of 0.1, and take the sine of all the points. Let's plot this fundamental frequency.