Use of corrcoef function

1 次查看(过去 30 天)
Theodoros Stylianides
Hello all,
I might be asking an arbitrary one today.
I am trying to familiarise myself to the use of corrcoef function so here it goes: Assume N is a given matrix and X & Y correspond to different columns (N(:,1) and N(:,2) in that array:
I'm struggling to understand what corrcoef (x y) and corrcoef(N) result to.
The code (an extract) i use for corrcoef (x y) is below:
for i=2:SampleLength;
for j=2:SampleLength;
X=N([a:b],i); %a , b define specific boundaries
Y=N([a:b],j)
[Correlation,Significance]=corrcoef(X,Y);
test(i-1,j-1)=Correlation(2,1);
sign(i-1,j-1)=Significance(2,1);
end
end
This extracts the coefficients and p-values.
But in the same time i can just run :
[Correlation,Significance]=corrcoef(N)
but end up with a different correlation matrix.
Any input on this?
Thanks in advance

回答(1 个)

Abhishek Ballaney
Abhishek Ballaney 2018-1-29
https://in.mathworks.com/help/matlab/ref/corrcoef.html

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by