Ok, I have the following problem in Matlab and it has been bugging me for quite some time now: Lets say I have 2 vectors (x and y) and I wish to get the correlation between them. I can call the function corrcoef which returns a matrix, but I am only interested in the element at position (1,2) since the other positions are duplicates or simply the number 1 along the diagonal.
I can do this with c = corrcoef(x,y);
but this gives a whole matrix... How can I get the correlation of x and y in one line of code? Now I do: C = corrcoef(x,y); c = C(1,2);
but I want to do this in one line...