Thanks for the reply!
The cosine is sampled well above the Nyquist limit.
I think it may have to do with the frequency scale, though I don't quite see it. The Matlab code is:
fs = 0.0001;
t = 0:fs:0.5;
y = cos(50*2*pi.*t);
t = 0:fs:1.5;
y = [zeros(1,0.5/fs), y, zeros(1,0.5/fs)]...