# How do you perform correlation coefficient for every ten rows in a specific column of a matrix?

1 vue (au cours des 30 derniers jours)
Chandler Quinn Stokes le 17 Juin 2021
I have a somewhat large matrix (685 rows by 12 columns) that I need to take the correlation coefficient over every ten rows of specific columns that I need to specify. Any help would be appreciated.
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Réponses (1)

Vimal Rathod le 21 Juin 2021
Hi,
You could use the following snippet to find out correlation coefficient over every 10 rows of some specific column.
r = rand(685,12);
column = 3; % specify the column in which you want correlation coefficient
for i = 1:10:numel(r(:,1))
if(i+9 < 685)
b(:,i) = r(i:i+9,column);
end
end
c = corrcoef(b);
Hope this helps!
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Logical dans Help Center et File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by