<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Dear Fieldtrippers, </div>
<div> </div>
<div>I am trying to use cluster-based permutation tests on my ERP data. I have adapted the code from http://www.fieldtriptoolbox.org/tutorial/cluster_permutation_timelock under "Within-subjects experiments". The only thing that I changed is the number of subjects under the variable "subj" and the name of the timelocked averages. </div>
<div> </div>
<div>When trying to run it, I always get the following error message: </div>
<div><span style="font-family:courier new,courier,monospace;">Error using ft_timelockstatistics (line 165)<br/>
the length of the design matrix (2) does not match the number of observations in the data<br/>
(2306)</span></div>
<div> </div>
<div>However, when I add the following to the cfg-structure, it works: </div>
<div><span style="font-family:courier new,courier,monospace;">cfg.parameter = 'avg';</span></div>
<div> </div>
<div><span style="font-family:verdana,geneva,sans-serif;">Has anyone any idea what the problem could be? Does it matter whether I choose "avg" instead of "trial"?</span></div>
<div> </div>
<div><font face="verdana, geneva, sans-serif">My experiment is a within-subjects design with two conditions, I have data from 30 subjects. My design matrix looks like this, with ivar in the first row and uvar in the second:</font></div>
<div>
<div><span style="font-family:courier new,courier,monospace;"> Columns 1 through 14</span></div>
<div><span style="font-family:courier new,courier,monospace;"> 1 1 1 1 1 1 1 1 1 1 1 1 1 1<br/>
1 2 3 4 5 6 7 8 9 10 11 12 13 14</span></div>
<div><span style="font-family:courier new,courier,monospace;"> Columns 15 through 28</span></div>
<div><span style="font-family:courier new,courier,monospace;"> 1 1 1 1 1 1 1 1 1 1 1 1 1 1<br/>
15 16 17 18 19 20 21 22 23 24 25 26 27 28</span></div>
<div><span style="font-family:courier new,courier,monospace;"> Columns 29 through 42</span></div>
<div><span style="font-family:courier new,courier,monospace;"> 1 1 2 2 2 2 2 2 2 2 2 2 2 2<br/>
29 30 1 2 3 4 5 6 7 8 9 10 11 12</span></div>
<div><span style="font-family:courier new,courier,monospace;"> Columns 43 through 56</span></div>
<div><span style="font-family:courier new,courier,monospace;"> 2 2 2 2 2 2 2 2 2 2 2 2 2 2<br/>
13 14 15 16 17 18 19 20 21 22 23 24 25 26</span></div>
<div><span style="font-family:courier new,courier,monospace;"> Columns 57 through 60</span></div>
<div><span style="font-family:courier new,courier,monospace;"> 2 2 2 2<br/>
27 28 29 30</span></div>
</div></div></body></html>