Cannot compute rank correlations for complex inputs.

1 visualización (últimos 30 días)
Marimuthu Ananthavelu
Marimuthu Ananthavelu el 23 de Mayo de 2019
Comentada: dpb el 23 de Mayo de 2019
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 comentario
dpb
dpb el 23 de Mayo de 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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre EEG/MEG/ECoG en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by