Compute phase coherence between two eeg signals I have two EEG signals/channels and I would like to compute phase coherence in MATLAB. I have this paper: https://www.nature.com/npp/journal/v39/n5/full/npp2013330a.html but it does not say what Sij is so I don't know the formula.

Can anyone advise me on how to do this or does anyone have MATLAB code?

Many thanks.
Perhaps the built-in 'mscohere' and 'cpsd' functions may help you.

The mscohere function returns a value between 0 and 1 that measures the correlation between the signals, and the phase delay can be computed using the cpsd function, as per this example from the Mathworks website. It suggests that the relative phase between the correlated components can be estimated with the cross-spectrum phase.

https://uk.mathworks.com/help/signal/examples/measuring-signal-similarities.html#d119e1563

Taken from the Mathworks page above

[Cxy,f] = mscohere(sig1,sig2,[],[],[],Fs);
Pxy     = cpsd(sig1,sig2,[],[],[],Fs);
phase   = -angle(Pxy)/pi*180;