Hi,
Is it:
or rather
Thanks a lot!
             
            
              1 Like 
            
                
            
           
          
            
            
              Hi Sebastian,
To get the connectivity matrix correctly formatted, you can do the following:
Read the file timefreq_connect…mat into the variable TfMat, or right-click > File > Export to Matlab > “TfMat” 
R = bst_memory(‘GetConnectMatrix’, TfMat); 
The matrix R is the connectivity matrix [signalsA x signalsB x Frequencies] 
The frequency bins are described in the TfMat.Freqs: R(:,:,1) is frequency TfMat.Freqs(1) 
 
For details on the algorithm, see directly the process function process_compress_sym.m
Cheers,
             
            
              
                
            
           
          
            
            
              Another question about PTE data. Is the phase-lag variable stored somewhere in the .mat file or just the PTE values?
Thanks
             
            
              
            
           
          
            
            
              Only the PTE data.
  
  
    
% Get frequency bands
 
nFreqBands = size(OPTIONS.Freqs, 1);
 
BandBounds = process_tf_bands('GetBounds', OPTIONS.Freqs);
 
% Intitialize returned matrix
 
R = zeros(size(sInputA.Data,1), size(sInputB.Data,1), nFreqBands);
 
% Loop on each frequency band
 
for iBand = 1:nFreqBands
 
    % Band-pass filter in one frequency band + Apply Hilbert transform
 
    DataAband = process_bandpass('Compute', sInputA.Data, sfreq, BandBounds(iBand,1), BandBounds(iBand,2), 'bst-hfilter-2019', OPTIONS.isMirror);
 
    % Compute PTE
 
    [dPTE, PTE] = PhaseTE_MF(permute(DataAband, [2 1]));
 
    if OPTIONS.isNormalized
 
        R(:,:,iBand) = dPTE;
 
        R(:,:,iBand) = R(:,:,iBand) - 0.5; % Center result around 0
 
    else
 
        R(:,:,iBand) = PTE;
 
    end
 
end
 
% We don't want to compute again the frequency bands
 
FreqBands = [];