function s=gsmooth(a,w)
% smooth(a,v) smooths vector with a gaussian
% convolution function of with w
% See also tsmooth(a,w)  ...  triangular smooth
% and bsmooth(a,w)   ...  boxcar (unweigthed sliding average) smooth
center=length(a)./2;
v=gaussian([center-w:center+w],center,w);
S=conv(a,v);
startpoint=round((length(v) + 1)/2);
endpoint=round(length(a)+startpoint-1);
s=S(startpoint:endpoint) ./ sum(v);
