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
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 Center および File Exchange で EEG/MEG/ECoG についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!