cross_selection_correlated_channels.m 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. clear row
  2. clear col
  3. clear source
  4. clear target
  5. %% eliminates self connections
  6. for t = 1 : length(cross)
  7. cross(t,t) = 0;
  8. end
  9. %% eliminate NaN values
  10. cross(find(isnan(cross)))=0;
  11. %%
  12. % %% REMOVE ARTEFACTED CHANNELS
  13. % artefacted_channels = [4 19 37 46 62 63];
  14. % for u = 1 : length(artefacted_channels)
  15. % cross(artefacted_channels(u) , :)=0;
  16. % cross(: , artefacted_channels(u))=0;
  17. % end
  18. % %%
  19. %SELECT TRESHOLD VALUE%
  20. treshold=0.7; %for fixed threshold
  21. [row,col]=find(cross>treshold); %for fixed threshold
  22. if isempty(row)
  23. error('No correlations were found with the defined threshold value! Change the threshold value in cross_selection_correlated_channels.m')
  24. end
  25. j=0;
  26. for i=1:length(row)
  27. % if delay(row(i),col(i)) >= 0;
  28. j=j+1;
  29. % row(i)
  30. % col(i)
  31. % pause
  32. formatSpec = 'channels: %2.0f and %2.0f \n';
  33. fprintf(formatSpec,col(i),row(i))
  34. source(j)=col(i);
  35. target(j)=row(i);
  36. weight(j)=cross(row(i),col(i));
  37. % end
  38. end
  39. N=length(source);
  40. %%
  41. map()