diff --git a/functions/popfunc/pop_topoplot.m b/functions/popfunc/pop_topoplot.m index a943e5958..19a59b144 100644 --- a/functions/popfunc/pop_topoplot.m +++ b/functions/popfunc/pop_topoplot.m @@ -255,7 +255,8 @@ if isempty(nonEmptyChans) nonEmptyChans = 1:EEG.nbchan; end - SIGTMPAVG = mean(SIGTMP(nonEmptyChans,pos,:),3); + SIGTMPAVG = nan(EEG.nbchan, length(pos)); + SIGTMPAVG(nonEmptyChans,:) = mean(SIGTMP(nonEmptyChans,pos,:),3); SIGTMPAVG(nonEmptyChans, nanpos) = NaN; if isempty(maplimits)