cas=eog(:,1);
horiz=eog(:,2);
vert=eog(:,3);
zacatek=189;

figure(1)
plot(horiz)
figure(2)
plot(vert)
horiz2=zeros(length(horiz),1);

A=(zacatek:100:length(horiz));

for i=1:(length(A)-1)
    vektor=horiz(A(i):A(i+1));
    soucet=sum(vektor);
    hodnota=soucet/length(vektor);
    novyvektor=hodnota*ones(length(vektor),1);
    horiz2(zacatek+(100*(i-1)):(zacatek+(100*i)))=novyvektor;
end

figure(3)
subplot(2,1,1)
plot(cas,horiz2)
xlabel('Čas [s]');
ylabel('Amplituda [mV]');

vert2=zeros(length(vert),1);

B=(zacatek:100:length(vert));

for i=1:(length(A)-1)
    vektor2=vert(A(i):A(i+1));
    soucet2=sum(vektor2);
    hodnota2=soucet2/length(vektor2);
    novyvektor2=hodnota2*ones(length(vektor2),1);
    vert2(zacatek+(100*(i-1)):(zacatek+(100*i)))=novyvektor2;
end
figure(3)
subplot(2,1,2)
plot(cas,vert2)
xlabel('Čas [s]');
ylabel('Amplituda [mV]');