MATLAB Plot of FT(Cos) Displays Weird Impulse
That's because Matlab preforms FFT, the formula that you referred to is the FT of your signal, the difference between the two can be derived by convolving the DTFT (which has the same form of the FT) with the sinc function, which in your case is close to a delta function.  For that reason you get a slight different frequancy domain from the theory you would expect