Then it is easy to take an Nx1 vector and compute the NxN covariance matrix but tedious. This is the video link that helped me: It assumes that you have a vector of random variable values (instances) where each element represents the functions to be compared with covariance and that for each element in the vector you already know the expected value. To expand on Rody's answer, the covariance matrix for a solid ellipse has eigenvalues given by lambdai ri2/4. The OP's equation is valid for the covariance matrix of a solid ellipse. The built in function cov() does not provide any options here. The factor sqrt (2) is because the covariance matrix is computed from points along the perimeter of the ellipse, not a solid ellipse. Then the covariance of that vector would be calculated with nested for loops iterating through the array and computing the elementwise covariance manually. In your case you will need to know the expected value of each of the random variables in your vector ahead of time. The cov() function appears to be designed for a large data set where the mean value can be determined. If the cov() function in Matlab had an input element option for the expected value of the two functions then it would work but it does not. I know this question is old but I came across this page looking for the same answer.