I have the data y as follows and I am trying to find the covariance between the 1st row and 2nd row, 2nd row and 3rd row, 3rd row and 4th row, so on. I don't seem to be able to save the values into a matrix either and would appreciate any hints. Thank you!
y = rand(20,1)
for i = 1:20