<div dir="ltr"><span style="font-size:12.8px">Dear all,</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I'm trying to make an ERP grand average using version 20150301. In some subjects I deleted bad channels. Those channels were replaced for NaNs. When I make the grand average using ft_timelockaverage, the grand average is composed only for the common channels across subjects. In other words, in channels deleated at least in one subject the grand average is NaN. This is because ft_timelockanalysis in this version calculates the average making a sum and dividng into degrees of freedom:</div><span style="font-size:12.8px"><div><br></div><div><i>grandavg.avg   = reshape(sum(avgmat, 1), datsiz)./ResultDOF; </i></div><div><i><br></i></div><div>(in line 187 of revision '$Id: ft_timelockgrandaverage.m 10194 2015-02-11 09:08:16Z roboos $')<br></div><div><br></div></span><div style="font-size:12.8px">However, I tried version 20121014 that my colleague uses. In this version ft_timelockedanalysis makes a mean:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><i>ResultGrandavg = mean(avgmat, 1);</i><br></div><span style="font-size:12.8px"><div><br></div><div>(in line 183 of revision '$Id: ft_timelockgrandaverage.m 6750 2012-10-13 15:07:32Z roboos $')</div><div><br></div><div>In the version 20121014 is easy to make a correction that calculates a grand average taking into account NaNs (just changing mean for nanmean). However, in version 20150301 making a similar correction seems more complicated. </div><div><br></div><div>Question 1: Why version 20150301 calculates average using sum and division instead of using nanmean?</div><div>Question 2: Do someone have a suggestion about how to change version 20150301?</div><div><br></div><div>Any comment would be greatly appreciated.</div><div><br></div><div>Kind regards,</div><div>Eliana Nicolaisen</div></span></div>