    %%
    % create data set that avg the 4sec data over sesstions
    % @ori  channel *4sec *6epoch, ex: 256*1024*6
    % @out  channel *4sec        , ex: 256*1024
   
    %% sbj2_75_9hz Channel_Data;
    clear all;
    EEG1 = pop_loadset('sbj2_sessitonA10.set');
    EEG2 = pop_loadset('sbj2_sessitonB2.set');
    EEG3 = pop_loadset('sbj2_sessitonC3.set');
    EEG4 = pop_loadset('sbj2_sessitonD5.set');  
    % avg the epoches for each sesstion
    %sesstionA
    dataSesstion1 =  zeros([EEG1.nbchan length(EEG1.data(1,:,1:EEG1.trials))]);%initial the data_temp
    for channel=1:EEG1.nbchan%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([EEG2.nbchan length(EEG2.data(1,:,1:EEG2.trials))]);%initial the data_temp
    for channel=1:EEG2.nbchan%for each channel
        for i=1:EEG2.trials%for each epoche
            dataSesstion2(channel,:) = dataSesstion2(channel,:)+EEG2.data(channel,:,i);%sum each epoche
        end
        dataSesstion2(channel,:) = dataSesstion2(channel,:)/EEG2.trials;%get the average over epoches
    end
    
    %sesstionC
    dataSesstion3 =  zeros([EEG3.nbchan length(EEG3.data(1,:,1:EEG3.trials))]);%initial the data_temp
    for channel=1:EEG3.nbchan%for each channel
        for i=1:EEG3.trials%for each epoche
            dataSesstion3(channel,:) = dataSesstion3(channel,:)+EEG3.data(channel,:,i);%sum each epoche
        end
        dataSesstion3(channel,:) = dataSesstion3(channel,:)/EEG3.trials;%get the average over epoches
    end
    
    %sesstionD
    dataSesstion4 =  zeros([EEG4.nbchan length(EEG4.data(1,:,EEG4.trials))]);%initial the data_temp
    for channel=1:EEG4.nbchan%for each channel
        for i=1:EEG4.trials%for each epoche
            dataSesstion4(channel,:) = dataSesstion4(channel,:)+EEG4.data(channel,:,i);%sum each epoche
        end
        dataSesstion4(channel,:) = dataSesstion4(channel,:)/EEG4.trials;%get the average over epoches
    end
    
    %avg cross sesstions
    for channel=1:EEG1.nbchan%for each channel
        dataSesstion1to4(channel,:) = (dataSesstion1(channel,:)+dataSesstion2(channel,:)+dataSesstion3(channel,:)+dataSesstion4(channel,:))/4;
    end
    Channel_Data = dataSesstion1to4;%format: channel*(4sec data)
    save sbj2_75_9hz Channel_Data;
    
    %% sbj2_75_10hz Channel_Data;
    clear all;
    
    EEG1 = pop_loadset('sbj2_sessitonA3.set');
    EEG2 = pop_loadset('sbj2_sessitonB4.set');
    EEG3 = pop_loadset('sbj2_sessitonC1.set');
    EEG4 = pop_loadset('sbj2_sessitonD10.set');  
    %EEG1.trials = 6;
    
    % avg the epoches for each sesstion
    %sesstionA
    dataSesstion1 =  zeros([EEG1.nbchan length(EEG1.data(1,:,EEG1.trials))]);%initial the data_temp
    for channel=1:EEG1.nbchan%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([EEG2.nbchan length(EEG2.data(1,:,EEG2.trials))]);%initial the data_temp
    for channel=1:EEG2.nbchan%for each channel
        for i=1:EEG2.trials%for each epoche
            dataSesstion2(channel,:) = dataSesstion2(channel,:)+EEG2.data(channel,:,i);%sum each epoche
        end
        dataSesstion2(channel,:) = dataSesstion2(channel,:)/EEG2.trials;%get the average over epoches
    end
    
    %sesstionC
    dataSesstion3 =  zeros([EEG3.nbchan length(EEG3.data(1,:,EEG3.trials))]);%initial the data_temp
    for channel=1:EEG3.nbchan%for each channel
        for i=1:EEG3.trials%for each epoche
            dataSesstion3(channel,:) = dataSesstion3(channel,:)+EEG3.data(channel,:,i);%sum each epoche
        end
        dataSesstion3(channel,:) = dataSesstion3(channel,:)/EEG3.trials;%get the average over epoches
    end
    
    %sesstionD
    dataSesstion4 =  zeros([EEG4.nbchan length(EEG4.data(1,:,EEG4.trials))]);%initial the data_temp
    for channel=1:EEG4.nbchan%for each channel
        for i=1:EEG4.trials%for each epoche
            dataSesstion4(channel,:) = dataSesstion4(channel,:)+EEG4.data(channel,:,i);%sum each epoche
        end
        dataSesstion4(channel,:) = dataSesstion4(channel,:)/EEG4.trials;%get the average over epoches
    end
    
    %avg cross sesstions
    for channel=1:EEG1.nbchan%for each channel
        dataSesstion1to4(channel,:) = (dataSesstion1(channel,:)+dataSesstion2(channel,:)+dataSesstion3(channel,:)+dataSesstion4(channel,:))/4;
    end
    Channel_Data = dataSesstion1to4;%format: channel*(4sec data)
    save sbj2_75_10hz Channel_Data;
    
    %% sbj2_75_11hz Channel_Data;
    clear all;
    
    EEG1 = pop_loadset('sbj2_sessitonA7.set');
    EEG2 = pop_loadset('sbj2_sessitonB5.set');
    EEG3 = pop_loadset('sbj2_sessitonC9.set');
    EEG4 = pop_loadset('sbj2_sessitonD6.set'); 
    %EEG1.trials = 6;
     
    % avg the epoches for each sesstion
    %sesstionA
    dataSesstion1 =  zeros([EEG1.nbchan length(EEG1.data(1,:,EEG1.trials))]);%initial the data_temp
    for channel=1:EEG1.nbchan%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([EEG2.nbchan length(EEG2.data(1,:,EEG2.trials))]);%initial the data_temp
    for channel=1:EEG2.nbchan%for each channel
        for i=1:EEG2.trials%for each epoche
            dataSesstion2(channel,:) = dataSesstion2(channel,:)+EEG2.data(channel,:,i);%sum each epoche
        end
        dataSesstion2(channel,:) = dataSesstion2(channel,:)/EEG2.trials;%get the average over epoches
    end
    
    %sesstionC
    dataSesstion3 =  zeros([EEG3.nbchan length(EEG3.data(1,:,EEG3.trials))]);%initial the data_temp
    for channel=1:EEG3.nbchan%for each channel
        for i=1:EEG3.trials%for each epoche
            dataSesstion3(channel,:) = dataSesstion3(channel,:)+EEG3.data(channel,:,i);%sum each epoche
        end
        dataSesstion3(channel,:) = dataSesstion3(channel,:)/EEG3.trials;%get the average over epoches
    end
    
    %sesstionD
    dataSesstion4 =  zeros([EEG4.nbchan length(EEG4.data(1,:,EEG4.trials))]);%initial the data_temp
    for channel=1:EEG4.nbchan%for each channel
        for i=1:EEG4.trials%for each epoche
            dataSesstion4(channel,:) = dataSesstion4(channel,:)+EEG4.data(channel,:,i);%sum each epoche
        end
        dataSesstion4(channel,:) = dataSesstion4(channel,:)/EEG4.trials;%get the average over epoches
    end
    
    %avg cross sesstions
    for channel=1:EEG1.nbchan%for each channel
        dataSesstion1to4(channel,:) = (dataSesstion1(channel,:)+dataSesstion2(channel,:)+dataSesstion3(channel,:)+dataSesstion4(channel,:))/4;
    end
    Channel_Data = dataSesstion1to4;%format: channel*(4sec data)
    save sbj2_75_11hz Channel_Data;
    
     %% sbj2_75_12hz Channel_Data;
    clear all;
    
    EEG1 = pop_loadset('sbj2_sessitonA4.set');
    EEG2 = pop_loadset('sbj2_sessitonB10.set');
    EEG3 = pop_loadset('sbj2_sessitonC5.set');
    EEG4 = pop_loadset('sbj2_sessitonD1.set');
    %EEG1.trials = 6;
      
    % avg the epoches for each sesstion
    %sesstionA
    dataSesstion1 =  zeros([EEG1.nbchan length(EEG1.data(1,:,EEG1.trials))]);%initial the data_temp
    for channel=1:EEG1.nbchan%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([EEG2.nbchan length(EEG2.data(1,:,EEG2.trials))]);%initial the data_temp
    for channel=1:EEG2.nbchan%for each channel
        for i=1:EEG2.trials%for each epoche
            dataSesstion2(channel,:) = dataSesstion2(channel,:)+EEG2.data(channel,:,i);%sum each epoche
        end
        dataSesstion2(channel,:) = dataSesstion2(channel,:)/EEG2.trials;%get the average over epoches
    end
    
    %sesstionC
    dataSesstion3 =  zeros([EEG3.nbchan length(EEG3.data(1,:,EEG3.trials))]);%initial the data_temp
    for channel=1:EEG3.nbchan%for each channel
        for i=1:EEG3.trials%for each epoche
            dataSesstion3(channel,:) = dataSesstion3(channel,:)+EEG3.data(channel,:,i);%sum each epoche
        end
        dataSesstion3(channel,:) = dataSesstion3(channel,:)/EEG3.trials;%get the average over epoches
    end
    
    %sesstionD
    dataSesstion4 =  zeros([EEG4.nbchan length(EEG4.data(1,:,EEG4.trials))]);%initial the data_temp
    for channel=1:EEG4.nbchan%for each channel
        for i=1:EEG4.trials%for each epoche
            dataSesstion4(channel,:) = dataSesstion4(channel,:)+EEG4.data(channel,:,i);%sum each epoche
        end
        dataSesstion4(channel,:) = dataSesstion4(channel,:)/EEG4.trials;%get the average over epoches
    end
    
    %avg cross sesstions
    for channel=1:EEG1.nbchan%for each channel
        dataSesstion1to4(channel,:) = (dataSesstion1(channel,:)+dataSesstion2(channel,:)+dataSesstion3(channel,:)+dataSesstion4(channel,:))/4;
    end
    Channel_Data = dataSesstion1to4;%format: channel*(4sec data)
    save sbj2_75_12hz Channel_Data;
    
     %% sbj2_75_13hz Channel_Data;
    clear all;
    EEG1 = pop_loadset('sbj2_sessitonA2.set');
    EEG2 = pop_loadset('sbj2_sessitonB3.set');
    EEG3 = pop_loadset('sbj2_sessitonC4.set');
    EEG4 = pop_loadset('sbj2_sessitonD2.set');
    %EEG1.trials = 6;
      
    % avg the epoches for each sesstion
    %sesstionA
    dataSesstion1 =  zeros([EEG1.nbchan length(EEG1.data(1,:,EEG1.trials))]);%initial the data_temp
    for channel=1:EEG1.nbchan%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([EEG2.nbchan length(EEG2.data(1,:,EEG2.trials))]);%initial the data_temp
    for channel=1:EEG2.nbchan%for each channel
        for i=1:EEG2.trials%for each epoche
            dataSesstion2(channel,:) = dataSesstion2(channel,:)+EEG2.data(channel,:,i);%sum each epoche
        end
        dataSesstion2(channel,:) = dataSesstion2(channel,:)/EEG2.trials;%get the average over epoches
    end
    
    %sesstionC
    dataSesstion3 =  zeros([EEG3.nbchan length(EEG3.data(1,:,EEG3.trials))]);%initial the data_temp
    for channel=1:EEG3.nbchan%for each channel
        for i=1:EEG3.trials%for each epoche
            dataSesstion3(channel,:) = dataSesstion3(channel,:)+EEG3.data(channel,:,i);%sum each epoche
        end
        dataSesstion3(channel,:) = dataSesstion3(channel,:)/EEG3.trials;%get the average over epoches
    end
    
    %sesstionD
    dataSesstion4 =  zeros([EEG4.nbchan length(EEG4.data(1,:,EEG4.trials))]);%initial the data_temp
    for channel=1:EEG4.nbchan%for each channel
        for i=1:EEG4.trials%for each epoche
            dataSesstion4(channel,:) = dataSesstion4(channel,:)+EEG4.data(channel,:,i);%sum each epoche
        end
        dataSesstion4(channel,:) = dataSesstion4(channel,:)/EEG4.trials;%get the average over epoches
    end
    
    %avg cross sesstions
    for channel=1:EEG1.nbchan%for each channel
        dataSesstion1to4(channel,:) = (dataSesstion1(channel,:)+dataSesstion2(channel,:)+dataSesstion3(channel,:)+dataSesstion4(channel,:))/4;
    end
    Channel_Data = dataSesstion1to4;%format: channel*(4sec data)
    save sbj2_75_13hz Channel_Data;
    
     %% sbj2_120_9hz Channel_Data;
    clear all;
    EEG1 = pop_loadset('sbj2_sessitonA8.set');
    EEG2 = pop_loadset('sbj2_sessitonB6.set');
    EEG3 = pop_loadset('sbj2_sessitonC10.set');
    EEG4 = pop_loadset('sbj2_sessitonD7.set');
    %EEG1.trials = 6;
      
    % avg the epoches for each sesstion
    %sesstionA
    dataSesstion1 =  zeros([EEG1.nbchan length(EEG1.data(1,:,EEG1.trials))]);%initial the data_temp
    for channel=1:EEG1.nbchan%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([EEG2.nbchan length(EEG2.data(1,:,EEG2.trials))]);%initial the data_temp
    for channel=1:EEG2.nbchan%for each channel
        for i=1:EEG2.trials%for each epoche
            dataSesstion2(channel,:) = dataSesstion2(channel,:)+EEG2.data(channel,:,i);%sum each epoche
        end
        dataSesstion2(channel,:) = dataSesstion2(channel,:)/EEG2.trials;%get the average over epoches
    end
    
    %sesstionC
    dataSesstion3 =  zeros([EEG3.nbchan length(EEG3.data(1,:,EEG3.trials))]);%initial the data_temp
    for channel=1:EEG3.nbchan%for each channel
        for i=1:EEG3.trials%for each epoche
            dataSesstion3(channel,:) = dataSesstion3(channel,:)+EEG3.data(channel,:,i);%sum each epoche
        end
        dataSesstion3(channel,:) = dataSesstion3(channel,:)/EEG3.trials;%get the average over epoches
    end
    
    %sesstionD
    dataSesstion4 =  zeros([EEG4.nbchan length(EEG4.data(1,:,EEG4.trials))]);%initial the data_temp
    for channel=1:EEG4.nbchan%for each channel
        for i=1:EEG4.trials%for each epoche
            dataSesstion4(channel,:) = dataSesstion4(channel,:)+EEG4.data(channel,:,i);%sum each epoche
        end
        dataSesstion4(channel,:) = dataSesstion4(channel,:)/EEG4.trials;%get the average over epoches
    end
    
    %avg cross sesstions
    for channel=1:EEG1.nbchan%for each channel
        dataSesstion1to4(channel,:) = (dataSesstion1(channel,:)+dataSesstion2(channel,:)+dataSesstion3(channel,:)+dataSesstion4(channel,:))/4;
    end
    Channel_Data = dataSesstion1to4;%format: channel*(4sec data)
    save sbj2_120_9hz Channel_Data;
    
     %% sbj2_120_10hz Channel_Data;
    clear all;
    EEG1 = pop_loadset('sbj2_sessitonA1.set');
    EEG2 = pop_loadset('sbj2_sessitonB8.set');
    EEG3 = pop_loadset('sbj2_sessitonC6.set');
    EEG4 = pop_loadset('sbj2_sessitonD4.set');
    %EEG1.trials = 6;
      
    % avg the epoches for each sesstion
    %sesstionA
    dataSesstion1 =  zeros([EEG1.nbchan length(EEG1.data(1,:,EEG1.trials))]);%initial the data_temp
    for channel=1:EEG1.nbchan%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([EEG2.nbchan length(EEG2.data(1,:,EEG2.trials))]);%initial the data_temp
    for channel=1:EEG2.nbchan%for each channel
        for i=1:EEG2.trials%for each epoche
            dataSesstion2(channel,:) = dataSesstion2(channel,:)+EEG2.data(channel,:,i);%sum each epoche
        end
        dataSesstion2(channel,:) = dataSesstion2(channel,:)/EEG2.trials;%get the average over epoches
    end
    
    %sesstionC
    dataSesstion3 =  zeros([EEG1.nbchan length(EEG3.data(1,:,EEG3.trials))]);%initial the data_temp
    for channel=1:EEG3.nbchan%for each channel
        for i=1:EEG3.trials%for each epoche
            dataSesstion3(channel,:) = dataSesstion3(channel,:)+EEG3.data(channel,:,i);%sum each epoche
        end
        dataSesstion3(channel,:) = dataSesstion3(channel,:)/EEG3.trials;%get the average over epoches
    end
    
    %sesstionD
    dataSesstion4 =  zeros([EEG4.nbchan length(EEG4.data(1,:,EEG4.trials))]);%initial the data_temp
    for channel=1:EEG4.nbchan%for each channel
        for i=1:EEG4.trials%for each epoche
            dataSesstion4(channel,:) = dataSesstion4(channel,:)+EEG4.data(channel,:,i);%sum each epoche
        end
        dataSesstion4(channel,:) = dataSesstion4(channel,:)/EEG4.trials;%get the average over epoches
    end
    
    %avg cross sesstions
    for channel=1:EEG1.nbchan%for each channel
        dataSesstion1to4(channel,:) = (dataSesstion1(channel,:)+dataSesstion2(channel,:)+dataSesstion3(channel,:)+dataSesstion4(channel,:))/4;
    end
    Channel_Data = dataSesstion1to4;%format: channel*(4sec data)
    save sbj2_120_10hz Channel_Data;
    
    %% sbj2_120_11hz Channel_Data;
    clear all;
    EEG1 = pop_loadset('sbj2_sessitonA6.set');
    EEG2 = pop_loadset('sbj2_sessitonB1.set');
    EEG3 = pop_loadset('sbj2_sessitonC8.set');
    EEG4 = pop_loadset('sbj2_sessitonD3.set'); 
    %EEG1.trials = 6;
     
    % avg the epoches for each sesstion
    %sesstionA
    dataSesstion1 =  zeros([EEG1.nbchan length(EEG1.data(1,:,EEG1.trials))]);%initial the data_temp
    for channel=1:EEG1.nbchan%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([EEG2.nbchan length(EEG2.data(1,:,EEG2.trials))]);%initial the data_temp
    for channel=1:EEG2.nbchan%for each channel
        for i=1:EEG2.trials%for each epoche
            dataSesstion2(channel,:) = dataSesstion2(channel,:)+EEG2.data(channel,:,i);%sum each epoche
        end
        dataSesstion2(channel,:) = dataSesstion2(channel,:)/EEG2.trials;%get the average over epoches
    end
    
    %sesstionC
    dataSesstion3 =  zeros([EEG3.nbchan length(EEG3.data(1,:,EEG3.trials))]);%initial the data_temp
    for channel=1:EEG3.nbchan%for each channel
        for i=1:EEG3.trials%for each epoche
            dataSesstion3(channel,:) = dataSesstion3(channel,:)+EEG3.data(channel,:,i);%sum each epoche
        end
        dataSesstion3(channel,:) = dataSesstion3(channel,:)/EEG3.trials;%get the average over epoches
    end
    
    %sesstionD
    dataSesstion4 =  zeros([EEG4.nbchan length(EEG4.data(1,:,EEG4.trials))]);%initial the data_temp
    for channel=1:EEG4.nbchan%for each channel
        for i=1:EEG4.trials%for each epoche
            dataSesstion4(channel,:) = dataSesstion4(channel,:)+EEG4.data(channel,:,i);%sum each epoche
        end
        dataSesstion4(channel,:) = dataSesstion4(channel,:)/EEG4.trials;%get the average over epoches
    end
    
    %avg cross sesstions
    for channel=1:EEG1.nbchan%for each channel
        dataSesstion1to4(channel,:) = (dataSesstion1(channel,:)+dataSesstion2(channel,:)+dataSesstion3(channel,:)+dataSesstion4(channel,:))/4;
    end
    Channel_Data = dataSesstion1to4;%format: channel*(4sec data)
    save sbj2_120_11hz Channel_Data;
    
    %% sbj2_120_12hz Channel_Data;
    clear all;
    EEG1 = pop_loadset('sbj2_sessitonA9.set');
    EEG2 = pop_loadset('sbj2_sessitonB7.set');
    EEG3 = pop_loadset('sbj2_sessitonC2.set');
    EEG4 = pop_loadset('sbj2_sessitonD8.set'); 
    %EEG1.trials = 6;
     
    % avg the epoches for each sesstion
    %sesstionA
    dataSesstion1 =  zeros([EEG1.nbchan length(EEG1.data(1,:,EEG1.trials))]);%initial the data_temp
    for channel=1:EEG1.nbchan%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([EEG2.nbchan length(EEG2.data(1,:,EEG2.trials))]);%initial the data_temp
    for channel=1:EEG2.nbchan%for each channel
        for i=1:EEG2.trials%for each epoche
            dataSesstion2(channel,:) = dataSesstion2(channel,:)+EEG2.data(channel,:,i);%sum each epoche
        end
        dataSesstion2(channel,:) = dataSesstion2(channel,:)/EEG2.trials;%get the average over epoches
    end
    
    %sesstionC
    dataSesstion3 =  zeros([EEG3.nbchan length(EEG3.data(1,:,EEG3.trials))]);%initial the data_temp
    for channel=1:EEG3.nbchan%for each channel
        for i=1:EEG3.trials%for each epoche
            dataSesstion3(channel,:) = dataSesstion3(channel,:)+EEG3.data(channel,:,i);%sum each epoche
        end
        dataSesstion3(channel,:) = dataSesstion3(channel,:)/EEG3.trials;%get the average over epoches
    end
    
    %sesstionD
    dataSesstion4 =  zeros([EEG4.nbchan length(EEG4.data(1,:,EEG4.trials))]);%initial the data_temp
    for channel=1:EEG4.nbchan%for each channel
        for i=1:EEG4.trials%for each epoche
            dataSesstion4(channel,:) = dataSesstion4(channel,:)+EEG4.data(channel,:,i);%sum each epoche
        end
        dataSesstion4(channel,:) = dataSesstion4(channel,:)/EEG4.trials;%get the average over epoches
    end
    
    %avg cross sesstions
    for channel=1:EEG1.nbchan%for each channel
        dataSesstion1to4(channel,:) = (dataSesstion1(channel,:)+dataSesstion2(channel,:)+dataSesstion3(channel,:)+dataSesstion4(channel,:))/4;
    end
    Channel_Data = dataSesstion1to4;%format: channel*(4sec data)
    save sbj2_120_12hz Channel_Data;
    
    %% sbj2_120_13hz Channel_Data;
    clear all;
    EEG1 = pop_loadset('sbj2_sessitonA5.set');
    EEG2 = pop_loadset('sbj2_sessitonB9.set');
    EEG3 = pop_loadset('sbj2_sessitonC7.set');
    EEG4 = pop_loadset('sbj2_sessitonD9.set');  
    %%EEG1.trials = 6;
    
    % avg the epoches for each sesstion
    %sesstionA
    dataSesstion1 =  zeros([EEG1.nbchan length(EEG1.data(1,:,EEG1.trials))]);%initial the data_temp
    for channel=1:EEG1.nbchan%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([EEG2.nbchan length(EEG2.data(1,:,EEG2.trials))]);%initial the data_temp
    for channel=1:EEG2.nbchan%for each channel
        for i=1:EEG2.trials%for each epoche
            dataSesstion2(channel,:) = dataSesstion2(channel,:)+EEG2.data(channel,:,i);%sum each epoche
        end
        dataSesstion2(channel,:) = dataSesstion2(channel,:)/EEG2.trials;%get the average over epoches
    end
    
    %sesstionC
    dataSesstion3 =  zeros([EEG3.nbchan length(EEG3.data(1,:,EEG3.trials))]);%initial the data_temp
    for channel=1:EEG3.nbchan%for each channel
        for i=1:EEG3.trials%for each epoche
            dataSesstion3(channel,:) = dataSesstion3(channel,:)+EEG3.data(channel,:,i);%sum each epoche
        end
        dataSesstion3(channel,:) = dataSesstion3(channel,:)/EEG3.trials;%get the average over epoches
    end
    
    %sesstionD
    dataSesstion4 =  zeros([EEG4.nbchan length(EEG4.data(1,:,EEG4.trials))]);%initial the data_temp
    for channel=1:EEG4.nbchan%for each channel
        for i=1:EEG4.trials%for each epoche
            dataSesstion4(channel,:) = dataSesstion4(channel,:)+EEG4.data(channel,:,i);%sum each epoche
        end
        dataSesstion4(channel,:) = dataSesstion4(channel,:)/EEG4.trials;%get the average over epoches
    end
    
    %avg cross sesstions
    for channel=1:EEG1.nbchan%for each channel
        dataSesstion1to4(channel,:) = (dataSesstion1(channel,:)+dataSesstion2(channel,:)+dataSesstion3(channel,:)+dataSesstion4(channel,:))/4;
    end
    Channel_Data = dataSesstion1to4;%format: channel*(4sec data)
    save sbj2_120_13hz Channel_Data;