%% sbj1_75_9hz Channel_Data;
    clear all;
    EEG1 = pop_loadset('sbj1_sessitonA10.set');
    EEG2 = pop_loadset('sbj1_sessitonB2.set');
    EEG3 = pop_loadset('sbj1_sessitonC3.set');
    EEG4 = pop_loadset('sbj1_sessitonD5.set');  
    %EEG1.trials = EEG1.trials;
    EEG1.channels = EEG1.nbchan;
    % avg the epoches for each sesstion
    %sesstionA
    dataSesstion1 =  zeros([EEG1.channels length(EEG1.data(1,:,1:6))]);%initial the data_temp
    for channel=1:EEG1.channels%for each channel
        for i=1:EEG1.trials%for each epoche
            dataSesstion1(channel,:) = dataSesstion1(channel,:)+EEG1.data(channel,:,i);%sum each epoche
        end
        dataSesstion1(channel,:) = dataSesstion1(channel,:)/EEG1.trials;%get the average over epoches
    end
    
    %sesstionB
    dataSesstion2 =  zeros([EEG1.channels length(EEG1.data(1,:,1:6))]);%initial the data_temp
    for channel=1:EEG1.channels%for each channel
        for i=1:EEG1.trials%for each epoche
            dataSesstion2(channel,:) = dataSesstion2(channel,:)+EEG2.data(channel,:,i);%sum each epoche
        end
        dataSesstion2(channel,:) = dataSesstion2(channel,:)/EEG1.trials;%get the average over epoches
    end
    
    %sesstionC
    dataSesstion3 =  zeros([EEG1.channels length(EEG1.data(1,:,1:6))]);%initial the data_temp
    for channel=1:EEG1.channels%for each channel
        for i=1:EEG1.trials%for each epoche
            dataSesstion3(channel,:) = dataSesstion3(channel,:)+EEG3.data(channel,:,i);%sum each epoche
        end
        dataSesstion3(channel,:) = dataSesstion3(channel,:)/EEG1.trials;%get the average over epoches
    end
    
    %sesstionD
    dataSesstion4 =  zeros([EEG1.channels length(EEG1.data(1,:,1:6))]);%initial the data_temp
    for channel=1:EEG1.channels%for each channel
        for i=1:EEG1.trials%for each epoche
            dataSesstion4(channel,:) = dataSesstion4(channel,:)+EEG4.data(channel,:,i);%sum each epoche
        end
        dataSesstion4(channel,:) = dataSesstion4(channel,:)/EEG1.trials;%get the average over epoches
    end
    
    %avg cross sesstions
    for channel=1:EEG1.channels%for each channel
        dataSesstion1to4(channel,:) = (dataSesstion1(channel,:)+dataSesstion2(channel,:)+dataSesstion3(channel,:)+dataSesstion4(channel,:))/4;
    end
    Channel_Data = dataSesstion1to4;%format: channel*(4sec data)
    save sbj1_75_9hz Channel_Data;