<div dir="ltr">Dear all,<div><br></div><div>I'm doing permutation tests, for which I wrote a script a while ago, which worked nicely back then, but now gives me the following error when I run the ft_prepare_neighbours function: </div><div><br></div><div>Error: Undefined function or variable 'hasdata'.<br></div><div><br></div><div>I'm assuming that this means that the function does not properly access the data structure that I give it. I just don't know why and how to fix it, given that the very same script worked about half a year ago. I have updated my version to Matlab 2016a in the meantime, but all other things stayed the same. </div><div><br></div><div>To give you a better idea, here is what my data looks like for one participant:</div><div><br></div><div><div>Data{1}</div><div>avg: [34x600 double]</div><div>time: [1x600 double]</div><div>fsample: '500'</div><div>label: {34x1 cell}</div><div>dimord: 'chan_time'</div><div>dof: [34x600 double]</div><div>var: [34x600 double]</div></div><div><br></div><div>I have data for 21 participants. </div><div><br></div><div>Here is the part of the script up until the prepare neighbours function, Correct and Incorrect being the respective datasets for my two conditions:</div><div><br></div><div>







<p class="">cfg = [];</p>
<p class="">cfg.channel   = <span class="">'all'</span>;</p>
<p class="">cfg.latency   = <span class="">'all'</span>;</p>
<p class="">cfg.parameter = <span class="">'avg'</span>;</p>
<p class=""> </p>
<p class="">% prepare neighbouring channels</p>
<p class="">cfg_neighb = [];</p>
<p class=""><span class="">cfg_neighb.method = </span><span class="">'triangulation'</span><span class="">; </span></p>
<p class="">cfg_neighb.channel = <span class="">'all'</span>;</p>
<p class="">cfg_neighb.feedback = <span class="">'yes'</span>;</p>
<p class="">cfg_neighb.layout = <span class="">'easycapCustomMSC.mat'</span>; </p>
<p class=""><span class="">cfg_neighb.neighbourdist = 0.2; </span></p>
<p class="">neighbours = ft_prepare_neighbours(cfg_neighb, Correct{1});</p><p class=""><br></p><p class="">I hope this is enough information to help me out. </p><p class=""><br></p><p class="">Thanks in advance,</p><p class="">Anne</p></div>







</div>