<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Laetitia,
<div class=""><br class="">
</div>
<div class="">My suggestion would be to check the sanity of the data structure, and to check the dimensionality of cfg.design.</div>
<div class=""><br class="">
</div>
<div class="">Since you handcrafted your numerical data, and don’t give any specifics w.r.t. the metadata (*.dimord, *.freq, *.time, *a.label) of your BigMatdef variable </div>
<div class="">It’s a mismatch between the data and the design that causes the error.</div>
<div class=""><br class="">
</div>
<div class="">I don’t understand why you index the cfg.design variable as if it’s a 4D matrix, typically it’s a row vector (or a matrix with a few rows), with the observations in the columns.</div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
</div>
<div class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 21 Oct 2021, at 09:30, Chauviere, Laetitia via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" style="font-size: 12pt; font-family: "Times New Roman", serif;" class="">Dear FieldTrip users,<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" style="font-size: 12pt; font-family: "Times New Roman", serif;" class="">I have a question regarding the function<span class="Apple-converted-space"> </span><b class=""><i class="">ft_freqstatistics</i></b>.<span class="Apple-converted-space"> </span><br class="">
<br class="">
I would like to do statistics on the powerspectrum data (output of the function<span class="Apple-converted-space"> </span><b class=""><i class="">ft_freqanalysis</i></b>) between two conditions (same monkey).<span class="Apple-converted-space"> </span><br class="">
<br class="">
I have the Data Input whose structure corresponds to the output of the function<span class="Apple-converted-space"> </span><i class="">ft_freqanalysis</i>, and the design matrix whose size is the same as the data input (datainput.powspctrm) : size(datainput.powspctrm)
 = size(cfg.design), and the data to compare are in datainput.powspctrm.<span class="Apple-converted-space"> </span><br class="">
<br class="">
BigMat = NaN(8670,1,182,164);<br class="">
BigMat (1:2078,1,1:91,1:77) = MM25;             <span style="color: rgb(0, 176, 80);" class="">% matrix (trials, channel, freq, time) – 1st condition<br class="">
</span>BigMat (2079:8670,1,92:182,78:164) = M25;  <span class="Apple-converted-space"> </span><span style="color: rgb(0, 176, 80);" class="">% matrix (trials, channel, freq, time) – 2nd condition<br class="">
</span><br class="">
BigMatdef = PowAllCond_ALLFBS{1,1};     <span style="color: rgb(0, 176, 80);" class="">% PowAllCond_ALLFBS{1,1} : output function ft_freqanalysis, so to get the same structure</span><br class="">
BigMatdef.powspctrm = BigMat;                      <span style="color: rgb(0, 176, 80);" class="">% big matrix (trials, channel,freq,time) – with the two conditions</span><br class="">
<br class="">
cfg.design(1:2078,:,:,:) = 1;         <span style="color: rgb(0, 176, 80);" class="">% 1st condition</span><br class="">
cfg.design(2079:8670,:,:,:) = 2;  <span class="Apple-converted-space"> </span><span style="color: rgb(0, 176, 80);" class="">% 2nd condition<br class="">
</span><br class="">
However I still have this error message from Matlab:<span class="Apple-converted-space"> </span><br class="">
"<span style="color: red;" class="">Error using ft_freqstatistics (line 294)<br class="">
the number of observations in the design does not match the number of observations in the data</span>"<br class="">
<br class="">
Any tip/suggestion?<span class="Apple-converted-space"> </span><br class="">
<br class="">
Many thanks in advance!<br class="">
<br class="">
Best,<br class="">
Laetitia.<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" style="font-size: 12pt; font-family: "Times New Roman", serif;" class="">Dr. Laetitia Chauvière - PhD<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" style="font-size: 12pt; font-family: "Times New Roman", serif;" class="">Post-Doc - Prof. Singer's lab - Room 303<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" style="font-size: 12pt; font-family: "Times New Roman", serif;" class="">Max Planck Institute for Brain Research<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 12pt; font-family: "Times New Roman", serif;" class="">Deutschordenstr. 46<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 12pt; font-family: "Times New Roman", serif;" class="">60528 Frankfurt am Main - Germany<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 12pt; font-family: "Times New Roman", serif;" class=""><a href="mailto:laetitia.chauviere@brain.mpg.de" style="color: purple; text-decoration: underline;" class="">laetitia.chauviere@brain.mpg.de</a><o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" style="font-size: 12pt; font-family: "Times New Roman", serif;" class="">T: +49 69 96769-272</span><span lang="EN-US" style="font-size: 12pt; font-family: "Times New Roman", serif;" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
</div>
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">fieldtrip
 mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" style="color: purple; text-decoration: underline; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!on07W9aDE29PzvTPBIUCi0hZuP9TA4hlXO-ygI12L8s6HbAtFRv7QOEFdzf48crMsLGXox9hr7pMJyg$" style="color: purple; text-decoration: underline; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!on07W9aDE29PzvTPBIUCi0hZuP9TA4hlXO-ygI12L8s6HbAtFRv7QOEFdzf48crMsLGXox9hr7pMJyg$</a><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""></span></div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>