Cannot compute rank correlations for complex inputs.

2 次查看(过去 30 天)
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 个评论
dpb
dpb 2019-5-23
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.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 EEG/MEG/ECoG 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by