When using Corrcoef
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Mate 2u
am 11 Mai 2012
Beantwortet: Ahsanul Hasan
am 17 Apr. 2016
Hi all, When using corrcoef on a matrix. Is there a way to get the mean of all the values on the bottom left triangular side or the top right triangle?
All the best,
0 Kommentare
Akzeptierte Antwort
Daniel Shub
am 11 Mai 2012
I am not sure exactly what you want ...
EDIT but not really different
N = 10;
x = randn(N);
y = corrcoef(x);
z = mean(y(tril(true(N))))
3 Kommentare
Daniel Shub
am 11 Mai 2012
I edited it to add the corrcoeft part and do the bottom-left and not top-right, but it doesn't change what I am doing. This what you want?
Wayne King
am 11 Mai 2012
If you don't want to average the main diagonl, which is necessarily all 1's, then use Daniel's code with
z = mean(y(tril(true(N),-1)))
Weitere Antworten (1)
Ahsanul Hasan
am 17 Apr. 2016
pls help me in matlab code for find correlation vs covariance
0 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!