<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hello Fieldtrippers,
<div><br>
</div>
<div>I am trying to use a monte carlo permutation test using ft_freqstatistics on grandaveraged data over 8 participants for two independent conditions but I am struggling to create the correct design matrix using the following code:</div>
<div><br>
</div>
<div>
<div>cfg = [];   cfg.method = 'montecarlo';    cfg.computestat = 'yes';  <span style="font-size: 10pt;">cfg.statistic = 'indepsamplesT'; cfg.numrandomization = 500;   cfg.correctm = 'fdr';  </span><span style="font-size: 10pt;">cfg.computecritval = 'yes'; cfg.alpha
 = 0.025; cfg.tail = 0; cfg.clustertail = 0;   </span><span style="font-size: 10pt;">cfg.clusterstatistic = 'maxsum';    cfg.minnbchan = 2;    </span></div>
<div><span style="font-size: 10pt;">design = zeros(1,size(T_LLL.powspctrm,1) + size(T_LLH.powspctrm,1));</span></div>
<div>design(1,1:size(T_LLL.powspctrm,1)) = 1;</div>
<div>design(1,(size(T_LLL.powspctrm,1)+1):(size(T_LLL.powspctrm,1)+<span style="font-size: 10pt;">size(T_LLH.powspctrm,1))) = 2;</span></div>
<div><span style="font-size: 10pt;">cfg.design           = design;</span></div>
<div>cfg.ivar             = 1;</div>
<div>[stat] = ft_freqstatistics(cfg, T_LLL, T_LLH); </div>
</div>
<div><br>
</div>
<div>I am left with the following error message:</div>
<div>"<span style="font-size: 10pt;">Error using ft_freqstatistics (line 174)</span></div>
<div>the length of the design matrix (1) does not match the number of observations</div>
<div>in the data (2)"</div>
<div><br>
</div>
<div><br>
</div>
<div>I am struggling to see what errors I am making and I have tried my best to adhere to the guidelines outlined on the Fieldtrip tutorials, so if anyone with a keen eye can offer any help it would be most appreciated!</div>
<div><br>
</div>
<div>Many thanks</div>
<div><br>
</div>
<div>Kelly</div>
<div><br>
</div>
<div><font color="#000080"><br>
</font></div>
<div><font color="#000080" size="1">PhD candidate</font></div>
<div>
<div style="font-family: 'Segoe UI', Helvetica, Arial, sans-serif; margin: 0px;">
<font face="Calibri,sans-serif"><font face="Arial,sans-serif" color="#000080" size="1">Department of Psychology</font></font></div>
<div style="font-family: 'Segoe UI', Helvetica, Arial, sans-serif; margin: 0px;">
<font face="Calibri,sans-serif"><font face="Arial,sans-serif" color="#000080" size="1">Aston University</font></font></div>
<div style="font-family: 'Segoe UI', Helvetica, Arial, sans-serif; margin: 0px;">
<font face="Calibri,sans-serif"><font face="Arial,sans-serif" color="#000080" size="1">Birmingham B4 7ET</font></font></div>
<div style="font-family: 'Segoe UI', Helvetica, Arial, sans-serif; margin: 0px;">
<font face="Calibri,sans-serif"><font face="Arial,sans-serif" color="#000080" size="1">United Kingdom</font></font></div>
</div>
<div><br>
</div>
</div>
</body>
</html>