Understanding the output of rho=corr(x)
is the same as
If a single value is changed in x in column n, it should affect all of the correlation matrix results in row n and column n.
For example,
r =
1 & 1 1 & 1 1 & 3
2 & 1 2 & 2 2 & 3
3 & 1 3 & 2 3 & 3
If a value changes in column 3, you can see above that it would affect all values in column 3 and row 3 of the correlation matrix.
Here's a demo
x0 = [1 6 5; 9 3 5; 7 5 3; 5 9 5];
x1 = x0;
x1(10) = 9;
NaN infestation
As explained in this answer, a single NaN value in the input matrix of r=corr(x) at x(i,j) will result in all NaN values in row i and column j of the output matrix. A single NaN value in one of the two matrices x or y of r=corr(x,y) at coordinate (i,j) will result in a column of NaN values in column j of the output matrix but row i will otherwise be OK.
Ignoring missing values (e.g. NaN).
As explained in this answer, to compute column-wise correlation while ignoring missing values, set the 'Rows' property to either 'complete' or 'pairwise'.
Best Answer