function c = tchcov(X,Y)
%
% tchcov - Compute covariance of Y and X
% On input:
%     X: independent variable vector of length n
%     Y: dependent variable vector of length n
% On output:
%     c: covariance value
% Call:
%     c = tchcov(X,Y)
%

n = length(X);
Xmean = tchmean(X);
Ymean = tchmean(Y);
x = X-Xmean;
y = Y-Ymean;
c = (sum(x.*y))/(n-1);
