function s = var(x,m);
%VAR     s = var(x,m);
%
%Find the variance of samples in vector x.  If only x is given, the mean
%is estimated from the samples.

n=length(x);
if (nargin == 1),
  m=mean(x);
  n=n-1;
end
s=x-m;
s=sum(s.*s)/n;

