⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 eeg_grand_mean_ascii_script.m

📁 Matlab下的EEG处理程序库
💻 M
字号:
% EEG_GRAND_MEAN_ASCII_Script to generate grand mean ERP

clear; close all;

inpath  = 'd:\MyDocuments\emse_data\ptsd-pet\scd14hz\';
outpath = 'd:\MyDocuments\emse_data\ptsd-pet\grand_mean\';

file_ext = '_scd14hz.txt';
bin_ext  = '_scd14hz.mat';

format = '%12.4f ';

groups = {'c' 'p'};
subjects = {'01' '02' '03' '04' '05' '06' '07' '08' '09' '10'};
conditions = {'o' 'oac' 'oat' 'ouc' 'out' 't' 'tac' 'tad' 'tat' 'tuc' 'tud' 'tut'};

for c = 1:length(conditions)        cond = char(conditions(c));
    for g = 1:length(groups)        group = char(groups(g));
        for s = 1:length(subjects)  subj = strcat(group,char(subjects(s)));

            infile = strcat(inpath,subj,cond,file_ext);
            input = eeg_load_ascii(infile);
            
            if(s == 1)   add = zeros(size(input));
            else         add = add + input;
            end
        end
        
        avg = add / s;
        
        % output grand mean
        outfile = strcat(outpath,group,cond,file_ext);
        eeg_write_ascii(outfile,avg,format);
        
    end
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -