K = 201; % # of freq. to plot
N = 5;   % # copies of X(f) to use
fs = 5;  % sampling frequency
maxf = 2*fs; % largest freq. to plot
fvec = linspace(-maxf,maxf,K);
nuvec = fs*[-N:N]'; % column vector
fmat = repmat(fvec,2*N+1,1);
numat = repmat(nuvec,1,K);
Xmat = exp(-(fmat-numat).^2/2);
subplot(2,1,1)
plot(fvec',Xmat,'k')
grid on
subplot(2,1,2)
plot(fvec,sum(Xmat),'k')
grid on
axis([-inf inf 0 inf]
