<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hello,<br></div><div dir="ltr"><br></div><div>My name is Ana and I have recently started using Fieldtrip.</div><div>I am trying to adapt the <span class="gmail-gr_ gmail-gr_121 gmail-gr-alert gmail-gr_spell gmail-gr_inline_cards gmail-gr_disable_anim_appear gmail-ContextualSpelling gmail-ins-del gmail-multiReplace" id="gmail-121" style="display:inline;color:rgb(33,37,41);border-bottom:2px solid transparent;background-repeat:no-repeat;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">fieldtrip</span><span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""> tutorial -</span> '<span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">Cluster-based permutation tests on time-frequency data' - to my particular case (</span> <a href="http://www.fieldtriptoolbox.org/tutorial/cluster_permutation_freq/">http://www.fieldtriptoolbox.org/tutorial/cluster_permutation_freq/</a>)<span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">.</span></div><div><span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""><br></span></div><div><span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">I have data from one MEG subject recorded in an Elekta Neuromag system and would like to do a within trials analysis on that subject (experimental trials vs. control trials). However,   my </span><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">ft_freqstatistics outputs a matrix stat.stat full of NaNs. </font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">I am hoping to get some help with identifying the error in my pipeline.</font></div><div><span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""><br></span></div><div><span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">These are my steps:</span></div><div><span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""><br></span></div><div><span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""><b>1. I start by loading the two data structures corresponding to the Exp and Ctr trials (selecting only the gradiometer channels).</b></span></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"><u><i>Data fields</i></u></font><span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">:</span>  </div><div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">data_Exp = </font></div><div><span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">struct with fields:</span></div><div><span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">label: {202×1 cell}</span><br></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">trialinfo: [90×1 double]</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">sampleinfo: [90×2 double]</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">trial: {1×90 cell}</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">time: {1×90 cell}</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg: [1×1 struct]</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">fsample: 1.0000e+03</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"> grad: [1×1 struct]</font></div><div><br></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"><div>data_Ctr = </div><div>struct with fields:</div><div>label: {202×1 cell}</div><div>trialinfo: [90×1 double]</div><div>sampleinfo: [90×2 double]</div><div>trial: {1×90 cell}</div><div>time: {1×90 cell}</div><div>cfg: [1×1 struct]</div><div>fsample: 1.0000e+03</div><div>grad: [1×1 struct]</div></font></div><div style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""><br></div></div><div><b>3. Run the frequency analysis on both data structures. </b></div><div><div><i style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""><u>CFG</u></i><span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">:</span>  <font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"><br></font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg = [];</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.output = 'pow';</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.channel = {'MEGGRAD','-MEG1843', '-MEG2122'};</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.taper = 'hanning';</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.method = 'mtmconvol';</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.foi          = 10;%2:2:30;%1:30</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">numfoi = length(cfg.foi);</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.t_ftimwin    =  ones(length(cfg.foi),1).* 0.5;%1;</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.toi          = [-1 : 0.05: 3.6];</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.keeptrials = 'yes'; </font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">tfr_data_Exp = ft_freqanalysis(cfg, data_Exp);   </font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"><br></font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg = [];</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.output = 'pow';</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.channel = {'MEGGRAD','-MEG1843', '-MEG2122'};</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.taper = 'hanning';</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.method = 'mtmconvol';</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.foi          = 10; %2:2:30;</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">numfoi = length(cfg.foi);</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.t_ftimwin    =  ones(length(cfg.foi),1).* 0.5;</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.toi          = [-1 : 0.05: 3.6];</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.keeptrials = 'yes'; </font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">tfr_data_Ctr = ft_freqanalysis(cfg, data_Ctr);</font></div></div><div><br></div><div><u style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""><i>Data fields:</i></u> </div><div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">e.g. (and similar to the structure of </font> tfr_data_Exp<span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">)</span><span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""> </span></div></div><div><div>tfr_data_Ctr = </div><div>  struct with fields:</div><div>       label: {202×1 cell}</div><div>       dimord: 'rpt_chan_freq_time'</div><div>       freq: 10.0000</div><div>       time: [1×93 double]</div><div>       powspctrm: [90×202×1×93 double]</div><div>      cumtapcnt: [90×1 double]</div><div>      grad: [1×1 struct]</div><div>       trialinfo: [90×1 double]</div><div>      cfg: [1×1 struct]</div></div><div> <br></div><div><b><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">3. Combine planar gradiometers of the time-frequency data (e.g. tfr_data_Exp)</font></b></div><div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"><i><u>CFG</u></i>:</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg = [];</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.method = 'sum';</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">freqEXP_planar_cmb = ft_combineplanar(cfg,tfr_data_Exp);</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"><br></font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg = [];</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.method = 'sum';</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">freqCTR_planar_cmb = ft_combineplanar(cfg,tfr_data_Ctr);</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"><br></font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"><u><i>Data fields:</i></u></font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">e.g. (and similar to the structure of </font><span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">freqEXP_planar_cm)</span><span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""> </span></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"><div>freqCTR_planar_cmb = </div><div>struct with fields:</div><div>label: {102×1 cell}</div><div>dimord: 'rpt_chan_freq_time'</div><div>freq: 10.0000</div><div>time: [1×93 double]</div><div>powspctrm: [90×102×1×93 double]</div><div>cumtapcnt: [90×1 double]</div><div>grad: [1×1 struct]</div><div>trialinfo: [90×1 double]</div><div>cfg: [1×1 struct]</div></font></div><div><br></div></div><div><b>4. <font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"> Combine planar gradiometers also for the initial data structures (i.e. </font><span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">data_Exp</span><span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""> )</span></b></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"><div><i><u>CFG</u></i>:<span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif">  </span>  <br></div><div>cfg = [];</div><div>cfg.method = 'sum';</div><div>data_Exp_cmb = ft_combineplanar(cfg,data_Exp);</div><div><br></div><div><u><i>Data fields:</i></u>  <br></div><div><div>data_Exp_cmb = </div><div>struct with fields:</div><div>label: {102×1 cell}</div><div>trialinfo: [90×1 double]</div><div>sampleinfo: [90×2 double]</div><div>trial: {1×90 cell}</div><div>time: {1×90 cell}</div><div>cfg: [1×1 struct]</div><div>fsample: 1.0000e+03</div><div>grad: [1×1 struct]</div></div><div><br></div></font></div><div><span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""><b>5. Prepare neighbours, design, and run ft_freqstatistics</b></span></div><div><div><i style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""><u>CFG</u></i><span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">:</span>  <br></div><div>cfg = [];</div><div>cfg.channel          = {'MEGGRAD','-MEG1843', '-MEG2122'};</div><div>cfg.latency          = 'all';</div><div>cfg.frequency        = 10;</div><div>cfg.method           = 'montecarlo';</div><div>cfg.statistic        = 'ft_statfun_indepsamplesT';</div><div>cfg.correctm         = 'cluster';</div><div>cfg.clusteralpha     = 0.05;</div><div>cfg.clusterstatistic = 'maxsum';</div><div>cfg.minnbchan        = 2;</div><div>cfg.tail             = 0;</div><div>cfg.clustertail      = 0;</div><div>cfg.alpha            = 0.025;</div><div>cfg.numrandomization = 500;</div><div>% prepare_neighbours determines what sensors may form clusters</div><div>cfg_neighb.method    = 'distance';</div><div>cfg_neighb.template  = 'neuromag306plan.mat';</div><div>cfg.neighbours       = ft_prepare_neighbours(cfg_neighb, <b>data_Exp_cmb</b>);</div><div><br></div><div>design = zeros(1,size(freqCTR_planar_cmb.powspctrm,1) + size(freqEXP_planar_cmb.powspctrm,1));</div><div>design(1,1:size(freqCTR_planar_cmb.powspctrm,1)) = 1;</div><div>design(1,(size(freqCTR_planar_cmb.powspctrm,1)+1):(size(freqCTR_planar_cmb,1)+...</div><div>size(freqEXP_planar_cmb.powspctrm,1))) = 2;</div><div><br></div><div>cfg.design           = design;</div><div>cfg.ivar             = 1;</div><div><br></div><div>[stat] = ft_freqstatistics(cfg, <b>freqCTR_planar_cmb, freqEXP_planar_cmb</b>);</div></div><div><span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""><br></span></div><div><u style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""><i>Data fields:</i></u>  <span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""><br></span></div><div><div>stat.stat is a matrix full of NaN</div><div><br></div><div>stat.prob is a matrix of just ones</div></div><div><br></div><div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">stat = </font></div><div><span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">struct with fields:</span><br></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">stat: [102×1×93 double]</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">prob: [102×1×93 double]</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cirange: [102×1×93 double]</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">mask: [102×1×93 logical]</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">ref: [102×1×93 double]</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">dimord: 'chan_freq_time'</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">freq: 10.0000</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">grad: [1×1 struct]</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">label: {102×1 cell}</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">time: [1×93 double]</font></div><div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg: [1×1 struct]</font></div></div><div><br></div><div><b><u>Warning:</u></b></div><div>When running the ft_frestatistics I get the repeated warning:</div><div><br></div><div>(...)</div><div><div>Warning: Not all replications are used for the computation of the statistic. </div><div>Warning: Not all replications are used for the computation of the statistic. </div><div>Warning: Not all replications are used for the computing statistic 498 from 0</div><div>Warning: Not all replications are used for the computation of the statistic. </div><div>Warning: Not all replications are used for the computation of the statistic. </div><div>Warning: Not all replications are used for the computing statistic 500 from 0</div></div><div>(...)</div><div><br></div><div><br></div><div>Many many thanks!</div><div><br></div><div>Ana</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>