<div dir="ltr">Hey Jose,<div><br></div><div>It might not be the most elegant solution, but I would suggest something like ft_selectdata with ''cfg.avgovrfreq" & cfg.frequency=[10 50] arguments before the actual grandaverage.</div><div>Hope it helps.</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><font color="#000000">--</font></div><div><font color="#000000">Regards,<br></font></div><div><span style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><div style="text-align:left"><font color="#000000">Kousik Sarathy, S</font></div></span></div><div style="text-align:left"><br></div></div></div></div>
<br><div class="gmail_quote">On Wed, Jul 13, 2016 at 4:22 AM, Xie Wanze <span dir="ltr"><<a href="mailto:xiew1202@gmail.com" target="_blank">xiew1202@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"> Jose, <div> It is not difficult to do grand average across subjects or frequencies if I understand your questions correctly. </div><div> After you get the powspctrm matrix (chan x freq) for each subject, you can write a "for loop" to read in each person's data and then divided by the total number of subjects. Assuming you name your output structure as EEG_freq for each subject, the syntax would be something like:</div><div>  freqtotal = []; numsubject = 0;</div><div>  for i = 1:length(subjects)</div><div>     ...load your data here;</div><div>        if ~numsubject; freqtotal = EEG_freq.powspctrm;</div><div>        else; freqtotal = freqtotal + EEG_freq.powspctrm;</div><div>        end;</div><div>        numsubject = numsubject + 1;</div><div> end;</div><div> freqavg = freqtotal / numsubject;  or freqavg = freqtotal / length(subjects);</div><div><br></div><div> To get average across frequencies, simply use the "mean" function. If you have the chan x pow structure for your output then use "mean (freqavg, 2)" will do the average across the second dimension (i.e., frequencies). </div><div> Or you can do the average for frequencies for each subject then do the average across subjects. </div><div><br></div><div> Hope this will answer your questions.</div><div><br></div><div> Wanze </div><div><br></div><div>  </div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">2016-07-12 13:45 GMT-04:00 Jose <span dir="ltr"><<a href="mailto:joseluisblues@gmail.com" target="_blank">joseluisblues@gmail.com</a>></span>:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div><div>dear list,<br><br></div><div>I'm analysing <span>CTF</span> MEG data. I computed the power of my data for frequencies from 1 to 50 Hz. Is it possible to perform a grand average across my subjects, but additionally averaging across frequencies for exploratory purposes? Maybe there is a way to do it with ft_freqgrandaverage?, but so far I haven't find it,<br></div><br></div>Many thanks for any hint,</div>Jose<br></div>
<br></div></div>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>
<br>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>