<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div>Dear Jan-Mathijs, </div><div><br></div><div>thank you very much for fixing the typo in the code. </div><div>I do not get anymore the same error but as you predicted I get a new one. </div><div>I hope you can help me with that as well. </div><div><br></div><div>Best wishes</div><div>Manuela</div></div><div><br></div><div><br></div><div><div>Matrix dimensions must agree.</div><div><br></div><div>Error in ft_mvaranalysis>catnan (line 607)</div><div>    datamatrix(:,begsmp:endsmp) = datacells{trials(k)}(chanindx,:).*taper(ones(nchan,1),:);</div><div><br></div><div>Error in ft_mvaranalysis (line 425)</div><div><span style="white-space:pre">                          </span>dat = catnan(tmpdata.trial, chanindx, rpt{rlop}, tap(m,:), nnans, dobvar);</div><div><br></div><div>Error in Step2_Calculate_Granger_time_freq_updated_MC (line 124)</div><div>    mdata_emotional_Rem{subj} = ft_mvaranalysis(cfg, preprocessing_emotional_Rem_ds{subj});</div></div><div><br></div><div><br></div><div>I copy here the information about the structure (it's the same as before)</div><div><br></div><div>

<span lang="EN-US" style="text-decoration-style:initial;text-decoration-color:initial;font-size:10pt;font-family:"Courier New";color:black">The data is downsampled at 250 Hz. The fields of my data structure are fsample, trial, time, label and cfg. The size of preprocessing_emotional_Rem_<wbr>ds{1}.trial{1} </span><span style="text-decoration-style:initial;text-decoration-color:initial;color:black;font-family:"Courier New";font-size:10pt">is 3x3751 (channels, data points).</span>

<br></div><div><br></div><div>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">Configuration structure:<span></span></span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black"><span> </span></span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">cfg = [];<span></span></span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black"><span>   <span> </span></span>cfg.toolbox = 'bsmart';<span></span></span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black"><span>   <span> </span></span>cfg.order<span>  <span> </span></span>= 10;<span></span></span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black"><span>   <span> </span></span>cfg.toi<span>      <span> </span></span>= -0.5:0.01:3; %% the time points at which the windows are centered<span></span></span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black"><span>   <span> </span></span>cfg.t_ftimwin = 0.25; %% length of time window in second<span></span></span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black"><span>   <span> </span></span>mdata_emotional_Rem{subj} = ft_mvaranalysis(cfg, preprocessing_emotional_Rem_ds<wbr>{subj});</span></p>

<br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-08-31 11:32 GMT+02:00 Schoffelen, J.M. (Jan Mathijs) <span dir="ltr"><<a href="mailto:jan.schoffelen@donders.ru.nl" target="_blank">jan.schoffelen@donders.ru.nl</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="word-wrap:break-word">
Dear Manuela,
<div><br>
</div>
<div>This looks like a typo in the code, which I will fix (and once fixed will become available in the daily release version of the code). To give myself some time: probably not tonight, but perhaps after the weekend :). However, the fact that this
 part of the code clearly doesn’t work, I am not entirely sure whether the rest will work smoothly as well, as soon as the current hurdle is fixed. But let’s see</div>
<div><br>
</div>
<div>Best wishes,</div>
<div>Jan-Mathijs</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div>
<blockquote type="cite"><div><div class="h5">
<div>On 29 Aug 2018, at 13:34, Manuela Costa <<a href="mailto:manuela.costa@ctb.upm.es" target="_blank">manuela.costa@ctb.upm.es</a>> wrote:</div>
<br class="m_4496529063514022616Apple-interchange-newline">
</div></div><div><div><div class="h5">
<div dir="ltr">
<div dir="ltr">
<div style="margin:0cm 0cm 0.0001pt;line-height:normal;background-color:white;font-size:11pt;font-family:Calibri,sans-serif;background-position:initial initial;background-repeat:initial initial">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">Dear community,<span></span></span></div>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;line-height:normal;background:white;font-size:11pt;font-family:Calibri,sans-serif">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'"><span> </span></span></p>
<div style="margin:0cm 0cm 0.0001pt;line-height:normal;background-color:white;font-size:11pt;font-family:Calibri,sans-serif;background-position:initial initial;background-repeat:initial initial">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">I'm planning to do granger causality analysis on human iEEG data. I'm using ft_mvaranalysis to get time-dependent coefficient sets based on a sliding window, but I get an error. </span></div>
<div style="margin:0cm 0cm 0.0001pt;line-height:normal;background-color:white;font-size:11pt;font-family:Calibri,sans-serif;background-position:initial initial;background-repeat:initial initial">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'"><br>
</span></div>
<div style="margin:0cm 0cm 0.0001pt;line-height:normal;background-color:white;font-size:11pt;font-family:Calibri,sans-serif;background-position:initial initial;background-repeat:initial initial">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">The data is downsampled at 250 Hz. The fields of my data structure are fsample, trial, time, label and cfg. The size of preprocessing_emotional_Rem_<wbr>ds{1}.trial{1} </span><span style="font-family:'Courier New';font-size:10pt">is
 3x3751 (channels, data points). Below is the configuration structure and the error message. The ft_mvaranalysis function works if I do not use the sliding window approach. I tried to use different cfg.toi and cfg.t_ftimwin but I could not find a solution.
 I hope you can help me.</span></div>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;line-height:normal;background:white;font-size:11pt;font-family:Calibri,sans-serif">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'"><span> </span></span></p>
<div style="margin:0cm 0cm 0.0001pt;line-height:normal;background-color:white;font-size:11pt;font-family:Calibri,sans-serif;background-position:initial initial;background-repeat:initial initial">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">Best wishes,<span></span></span></div>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;line-height:normal;background:white;font-size:11pt;font-family:Calibri,sans-serif">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'"><span> </span></span></p>
<div style="margin:0cm 0cm 0.0001pt;line-height:normal;background-color:white;font-size:11pt;font-family:Calibri,sans-serif;background-position:initial initial;background-repeat:initial initial">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">Manuela Costa<span></span></span></div>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif">
<span style="font-size:10pt;font-family:'Courier New'"><span> </span></span></p>
<div style="margin:0cm 0cm 0.0001pt;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">Configuration structure:<span></span></span></div>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'"><span> </span></span></p>
<div style="margin:0cm 0cm 0.0001pt;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">cfg = [];<span></span></span></div>
<div style="margin:0cm 0cm 0.0001pt;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'"><span>   
</span>cfg.toolbox = 'bsmart';<span></span></span></div>
<div style="margin:0cm 0cm 0.0001pt;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'"><span>   
</span>cfg.order<span>   </span>= 10;<span></span></span></div>
<div style="margin:0cm 0cm 0.0001pt;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'"><span>   
</span>cfg.toi<span>       </span>= -0.5:0.01:3; %% the time points at which the windows are centered<span></span></span></div>
<div style="margin:0cm 0cm 0.0001pt;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'"><span>   
</span>cfg.t_ftimwin = 0.25; %% length of time window in second<span></span></span></div>
<div style="margin:0cm 0cm 0.0001pt;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'"><span>   
</span>mdata_emotional_Rem{subj} = ft_mvaranalysis(cfg, preprocessing_emotional_Rem_ds<wbr>{subj});<span></span></span></div>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'"><span> </span></span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'"><span> </span></span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'"><span> </span></span></p>
<pre style="margin:0cm 0cm 0.0001pt;font-size:10pt;font-family:"Courier New""><span>Error message:<span></span></span></pre>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'"><span> </span></span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'"><span> </span></span></p>
<div style="margin:0cm 0cm 0.0001pt;line-height:normal;background-color:white;font-size:11pt;font-family:Calibri,sans-serif;background-position:initial initial;background-repeat:initial initial">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">Matrix dimensions must agree.<span></span></span></div>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'"><span> </span></span></p>
<div style="margin:0cm 0cm 0.0001pt;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">Error in ft_mvaranalysis (line 185)<span></span></span></div>
<div style="margin:0cm 0cm 0.0001pt;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">latency(k,:) = cfg.toi + cfg.t_ftimwin.*[-0.5 0.5];<span></span></span></div>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'"><span> </span></span></p>
<div style="margin:0cm 0cm 0.0001pt;line-height:normal;background-color:white;font-size:11pt;font-family:Calibri,sans-serif;background-position:initial initial;background-repeat:initial initial">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">Error in Step2_Calculate_Granger_time_f<wbr>req(line 108)<span></span></span></div>
<div style="margin:0cm 0cm 0.0001pt;line-height:normal;background-color:white;font-size:11pt;font-family:Calibri,sans-serif;background-position:initial initial;background-repeat:initial initial">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">    mdata_emotional_Rem{subj} = ft_mvaranalysis(cfg,preprocess<wbr>ing_emotional_Rem_ds{subj});<span></span></span></div>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif">
<span lang="EN-US" style="font-size:10pt;font-family:'Courier New'"><span> </span></span></p>
<div style="margin:0cm 0cm 0.0001pt;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif">
<br>
<br>
</div>
</div>
</div></div></div>
______________________________<wbr>_________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" target="_blank">https://doi.org/10.1371/<wbr>journal.pcbi.1002202</a><br>
</div>
</blockquote>
</div>
<br>
</div>
</div>

<br>______________________________<wbr>_________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/<wbr>journal.pcbi.1002202</a><br>
<br></blockquote></div><br></div>