% filename=input('enter filename \n','s');
rate=input('enter acquisition rate \n');
aver_time=input('enter averaging time \n');


ws=data(:,8);
Time=data(:,1:6);
% temp=Time(:,4)/100;
% heure=fix(temp);
% minut=(temp-heure)*100;
% Time=[Time(:,1:3) heure minut Time(:,5)];
mean_time60=[];
mean_aver=[];
mean60=[];
mean_time_av=[];
L=length(ws);
n=[rate*60;aver_time*rate];
milieu=fix(n/2);

    for i=1:fix(L/n(1));
        A=mean(ws(n(1)*(i-1)+1:n(1)*i));
        mean60=[mean60;A];
        B=Time(n(1)*(i-1)+1+milieu(1),1:6);
        mean_time60=[mean_time60;B];
    end
    
   reste=L-n(1)*fix(L/n(1));
   reste_time=fix(reste/2);
   if reste >0
   reste=ws(n(1)*i+1:L);
   reste_time=Time(n(1)*i+1+reste_time,1:6);
   mean60=[mean60;mean(reste)];
   mean_time60=[mean_time60;reste_time];
end
   
   
   
    for i=1:fix(L/n(2));
        A=mean(ws(n(2)*(i-1)+1:n(2)*i));
        mean_aver=[mean_aver;A];
        B=Time(n(2)*(i-1)+1+milieu(2),1:6);
        mean_time_av=[mean_time_av;B];
    end
    
   reste=L-n(2)*fix(L/n(2));
   reste_time=fix(reste/2);
   if reste >0
      reste=ws(n(2)*(i)+1:L); 
      reste_time=Time(n(2)*i+1+reste_time,1:6);
   mean_aver=[mean_aver;mean(reste)];
   mean_time_av=[mean_time_av;reste_time];
end

ws_mean=mean_aver;