<div dir="ltr">Dear FieldTripppers,<div><br></div><div><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US">I was trying to do source connectivity analysis.
The EEG data is collected with Neuroscan system and with 64 channels cap. Preprocessing
was done with EEGLAB and translated to FieldTrip data structure. I used head model
and source model template provided by FieldTrip. Frequency analysis was done by
mtmfft method. Then inverse solution was calculated by eLORETA algorithm. But
when I tried to do connectivity analysis, the following error happened:</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US"> </span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US">Error using 
* </span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US">Requested 729444x729444 (7928.7GB) array
exceeds maximum array size preference. Creation of arrays greater than this
limit may take</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US">a long time and cause MATLAB to become
unresponsive. See array size limit or preference panel for more information. </span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US"> </span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US">Error in univariate2bivariate (line 316)</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US">         
data.crsspctrm = (transpose(mom)*conj(mom))./nrpt;</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US"> </span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US">Error in ft_connectivityanalysis (line 472)</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US">       
[data, powindx, hasrpt] = univariate2bivariate(data, 'mom', 'crsspctrm',
dtype, 'channelcmb', cfg.refindx, 'keeprpt', 0);</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US"> </span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US"> </span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US"> </span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US">This is my code for analysis:</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US"> </span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(60,118,61)">%% Transform preprocessed data from EEGLAB to FieldTrip
format</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">data = eeglab2fieldtrip(EEG, </span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(160,32,240)">'preprocessing'</span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">)</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black"> </span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(60,118,61)">%% Forward model</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(60,118,61)"> </span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(60,118,61)">% Read head model template from FieldTrip</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">template = ft_read_headmodel(</span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(160,32,240)">'standard_bem.mat'</span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">);</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">template = ft_convert_units(template, </span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(160,32,240)">'mm'</span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">);</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black"> </span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(60,118,61)">% Channal location </span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">elec = data.elec;</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black"> </span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(60,118,61)">% Electrodes re-alignment</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg = [];</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg.method = </span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(160,32,240)">'project'</span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">; </span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(60,118,61)">% onto scalp
surface</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg.headshape = template.bnd(1); </span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(60,118,61)">% scalp surface</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(60,118,61)"> </span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">elec_realigned = ft_electroderealign(cfg, elec);</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black"> </span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(60,118,61)">% Calculate BEM head model</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg              =
[];</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg.conductivity = [0.33 0.0042 0.33];</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg.method       = </span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(160,32,240)">'bemcp'</span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">headmodel_sphere = ft_prepare_headmodel(cfg,
template.bnd);</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black"> </span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">headmodel = headmodel_sphere;</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black"> </span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(60,118,61)">% Read source model template from FieldTrip</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">sourcemodel = ft_read_headshape(</span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(160,32,240)">'cortex_8196.surf.gii'</span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">)</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black"> </span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(60,118,61)">% Lead field calculation</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg = [];</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg.sourcemodel = sourcemodel;    </span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(60,118,61)">%% where
are the sources?</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg.headmodel   =
headmodel;      </span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(60,118,61)">%% how do currents spread?</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg.elec        =
elec_realigned; </span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(60,118,61)">%% where are the sensors?</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(60,118,61)"> </span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">sourcemodel_and_leadfield = ft_prepare_leadfield(cfg); </span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(60,118,61)">%% how do sources and sensors connect?</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(60,118,61)"> </span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(60,118,61)">%%</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(60,118,61)"> </span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(60,118,61)">% Calculate complex Fourier-spectra with fast Fourier
transformation</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg              =
[];</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg.output       = </span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(160,32,240)">'fourier'</span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg.channel      = </span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(160,32,240)">'EEG'</span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg.method       = </span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(160,32,240)">'mtmfft'</span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg.taper        = </span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(160,32,240)">'hanning'</span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg.foi          =
10;</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg.tapsmofrq    =
1;</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">TFRhann = ft_freqanalysis(cfg, data);</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black"> </span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">TFRhann = </span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black"> </span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">  struct with
fields:</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black"> </span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">            label:
{62×1 cell}</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">           dimord:
'rpttap_chan_freq'</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">             freq:
10</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">    fourierspctrm:
[89×62 double]</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">        cumsumcnt:
[89×1 double]</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">        cumtapcnt:
[89×1 double]</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">             elec:
[1×1 struct]</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">        trialinfo:
[89×1 table]</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">              cfg:
[1×1 struct]</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black"> </span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(60,118,61)">% Calculate inverse solution with eLORETA algorithm</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg               =
[];</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg.method        =
</span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(160,32,240)">'eloreta'</span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg.grid          =
sourcemodel_and_leadfield;</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg.headmodel     =
headmodel;</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg.eloreta.lambda   
= 3;</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">source        =
ft_sourceanalysis(cfg,TFRhann);</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">source        =
ft_sourcedescriptives([], source);</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black"> </span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-family:"Courier New"">source = </span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-family:"Courier New""> </span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-family:"Courier New"">  struct with
fields:</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-family:"Courier New""> </span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-family:"Courier New"">         freq: 10</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-family:"Courier New"">    cumtapcnt:
[89×1 double]</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-family:"Courier New"">          cfg: [1×1
struct]</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-family:"Courier New"">       inside:
[8196×1 logical]</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-family:"Courier New"">          pos:
[8196×3 double]</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-family:"Courier New"">          tri:
[16384×3 double]</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-family:"Courier New"">       method:
'average'</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-family:"Courier New"">          avg: [1×1
struct]</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-family:"Courier New""> </span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-family:細明體;color:black">The result is a 3xNtime matrix as the
source activation, which is in source.avg.mom (or in source.trial(i).mom). The
three rows of the moment are the strength of the source in the x-, y- and z-direction.</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-family:細明體;color:black"> </span></p>

<pre style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:細明體"><span lang="EN-US" style="color:black">source.avg.ori  % the orientation as an 1 x n cell array, where n is the number of locations and each cell is a 3 x 1 array of x y z orientation and n refers to the same source in each array</span><span lang="EN-US" style="color:black"></span></pre>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-family:"Courier New""> </span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(60,118,61)">% Connectivity analysis</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg         = [];</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg.method  =</span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(160,32,240)">'coh'</span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">cfg.complex = </span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(160,32,240)">'absimag'</span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">; </span><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:rgb(60,118,61)">% imaginary part
of coherence</span><span lang="EN-US" style="font-family:"Courier New""></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">source_conn = ft_connectivityanalysis(cfg, source);</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black"> </span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">Can you give me some advises on how to solve this problem?</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black"> </span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black">And I have another question. After the eLORETA source
reconstruction, the Fourier spectrum become three values which represent the strength
in x, y, z orientation. If I want to do connectivity analysis like coherence,
by definition I have to calculate cross-spectral density between the two
signals, how can I calculate the coherence value when I have three orientation
values?</span><span lang="EN-US" style="font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black"><br></span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black"><br></span></p><pre style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:細明體"><span lang="EN-US" style="color:black">I would appreciate your help,</span></pre><pre style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:細明體"><span lang="EN-US" style="color:black"> </span></pre><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:13pt;font-family:"Courier New";color:black"></span></p><pre style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:細明體"><span lang="EN-US" style="color:black">Kind regards,</span></pre><pre style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:細明體"><span lang="EN-US" style="color:black">Kao-Hung Lin</span></pre><pre style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:細明體"><span lang="EN-US" style="color:black">Master student</span></pre><pre style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:細明體"><span lang="EN-US" style="color:black">National Taiwan Normal University</span></pre><pre style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:細明體"><span lang="EN-US" style="color:black">e-mail: <a href="mailto:s129087158@gmail.com">s129087158@gmail.com</a></span></pre></div></div>