Plotting magnitude and phase for frequency spectrum
for plotting magnitude spectrum versus frequency you can use the following script:

t = 0:0.001:0.2;
s = sin(2*pi*100*t)+cos(pi*500*t);
S = abs(fftshift(fft(s)));

Fs = 1000;
df = 1000/(length(s));
f = -Fs/2:df:Fs/2-df;

plot(f,S);


Here I used your first signal and plotted its magnitude spectrum. You must notice for your signal min choosable Nyquist frequency is 500 Hz But we use it two times of it(which is 1000Hz), because we also want to see the part before f =0 in the frequency spectrum. Using this we find df(delta f) frequency spacing. frequency vector must be multiples of df. By this way spectrum will be drawn correctly.  

Here is the output: