harmonics of a signal and FFT
As Florent told: you must take fourier transform from your signal, by fft, then you will get your spectrum in normalized frequency, actual frequency is correspond to your sampling rate, then you can see amplitude and phase of each frequency(or harmonic) by these command: abs and angle.
For example, assume x is signal and T is time interval between your samples and 

x=[10 -10 10 -10 10 -10 -10 10 10 -10 -10]
X=fft(x);%you can set frequency resolution by setting fft(x,resolution)
Fs=1000;
f=linspace(1,Fs,length(X));
plot(f,angle(X))
figure
plot(f,abs(X))