Amplitude and Phase of FFT gives messy results - Matlab I'm trying to calculate the spectrum magnitude and phase of a signal, but when I plot them I get pretty messy results: 



The signal is displayed on the right, then I have the magnitude and phase of the fft in the centre and to the left accordingly.

I would have expected to see just few peaks in both the spectrums but instead there are a lot of peaks and it gets really messy.

This is my code:

T = mean(diff(t))
fs = 1/T

figure;
subplot(1,3,1)

plot(1000*t,sig);
title ('Time domain');  
xlabel('Time(ms)')
subplot(1,3,2)
plot((0:9999)/10,abs(fft(sig))); % magnitude spectrum
title('Spectrum');legend({'Magnitude'});
xlabel('Frequency (Hz)')
subplot(1,3,3)
plot((0:9999)/10,angle(fft(sig))); % phase spectrum
title('Spectrum');legend({'Phase'});
xlabel('Frequency (Hz)')


Am I missing something or is it supposed to be like this?

I tried already rounding off to zero values that are close to zero, but that did not change anything.
If you round off tiny magnitudes to zero (to remove numerical noise), you should also zero the matching phase result bins.  The phase of noise is usually just random.