自己的代码,主要函数topoplot,记得参数为一段时间内的mean(均值)
部分code如下:
%%%%%%%绘制脑电地形图EEGdataERP = sum(EEG.data,3);%把所有epochs对应相加,即所有epochs叠加EEGdataERP = EEGdataERP./size(EEG.data,3);%求平均,叠加后的数据除以epochs段数,即EEG.data的总页数size(EEG.data,3)num = EEG.nbchan;%通道数data1 = zeros(num,1);data1(:,1) = EEGdataERP(:,280);%第276列(350ms处)的所有数据,chanlocs = EEG.chanlocs;%电极位置信息ymin1=min(data1);ymax1=max(data1);figure;% figure('color','w');subplot(1,2,1);title('Target');topoplot(data1, chanlocs, 'electrodes','on','style','both','numcontour',6,'maplimits', [ymin1 ymax1],'shading','interp','conv','off');caxis([-4,7]);xlabel('Target');colorbar;%%%%%%%绘制非靶刺激脑电地形图EEGnontargetERP= sum(EEG.data,3);%把所有epochs对应相加,即所有epochs叠加EEGnontargetERP = EEGnontargetERP./size(EEG.data,3);%求平均,叠加后的数据除以epochs段数,即EEG.data的总页数size(EEG.data,3)data2 = zeros(num,1);%chaneels,1data2(:,1) = EEGnontargetERP(:,280);%第276列(350ms处)的所有数据,chanlocs = EEG.chanlocs;%电极位置信息ymin2=min(data2);ymax2=max(data2);subplot(1,2,2);title('Non-target');topoplot(data2, chanlocs, 'electrodes','on','style','both','numcontour',6,'maplimits', [ymin2 ymax2],'shading','interp','conv','off');caxis([-4,7]);colorbar;
完整版脑电地形图&anonva-p检验代码可在这里下载:
提供参考:
(133条消息) 使用eeglab代码绘制平均头皮图(任务期间特定频段平均的一张头皮图)_油泼西红柿的博客-CSDN博客https://ddong7./article/details/121799889?spm=1001..3001.5502