%%
gaussdens = @(x)exp(-x.^2/2)/sqrt(2*pi);
W = 1;           % BW of waveform
fsMin = 2*W;     % Nyquist rate
TsMax = 1/fsMin; % Nyquist period
Ts = .5;         % Actual sampling period
Tasamp = -5;     % Interval to sample
Tbsamp = 5;       
n = ceil((Tbsamp-Tasamp)/Ts); % # samples
tsamp = linspace(Tasamp,Tbsamp,n);
Taplot = -5;     % Interval to plot results
Tbplot = 5;
x = gaussdens(tsamp); % samples
t = linspace(Taplot,Tbplot,200);
y = smpthm(t,x,tsamp,W);      % sampling thm
% i = find(tsamp>=-1);
% tsamp = tsamp(i);
% x = x(i);
plot(tsamp,x,'o',t,y,'LineWidth',1.15,'MarkerSize',8)
title(['W=' num2str(W) ...
    ', Tasamp=' num2str(Tasamp) ', Tbsamp=' num2str(Tbsamp) ...
    ', Taplot=' num2str(Taplot) ', Tbplot=' num2str(Tbplot)],...
    'FontName','Times','FontSize',16)
set(gca,'FontName','Times','FontSize',20,'Box','Off')
% print('-depsc2','-r600','myMatlabFigure.eps')