added a function to calculate arbitrary covariance matrices of the correct size... matlab's built-in function always assumes x and y are 1d