function var = tchvar(v)
%
% tchvar - Compute variance of vector v
% On input:
%     v: vector of length n
% On output:
%     var: variance of vector v
% Call:
%     var = tchvar(v);
%

n = length(v);
vmean = tchmean(v);
devs = v-vmean;
sqrs = devs.^2;
var = sum(sqrs)/(n-1);
