<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">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><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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>_______________________________________________<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>