Cannot compute rank correlations for complex inputs.

1 visualizzazione (ultimi 30 giorni)
I am estimating the pairwise spearman correlation co-efficients on the EEG signals. They are of large datasets and I use the following code to estimate these;
function [Spearman_Rho_results]=spearman_corr(data)
Channels=size(data,1);
for i=1:Channels
for j=1:Channels
one=data(i,:);
two=data(j,:);
Spearman_Rho=corr(one',two','type','s');
Spearman_Rho_results(i,j)=Spearman_Rho;
end
end
end
It works well for some datasets. However for a specific dataset, it gives the following eroor;
Error using corr (line 200)
Cannot compute rank correlations for complex inputs.
I am unable to get the reasoning behind why this error happens to only this specific dataset while the remaining ones works fine with.
Any help is really appreiciable.
Thanks
Kind regards,
  1 Commento
dpb
dpb il 23 Mag 2019
Well, we can't either without the dataset in question/how you (or something/somebody else) process input to get the data array data but clearly somehow that particular dataset has complex values...
The problem is in your dataset, not in corr so you've got to back up and find out what went on there.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su EEG/MEG/ECoG in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by