function Y = sumConsecutive(matrice,N)
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%average N consecutive lines in the matrix
%%inputs:
%matrice: 2D matrix
%N: number of consecutive lines to average
%%output:
%Y: 2D matrix wherein the number of line is devided by N
%%exemple:
%sumConsecutive([1 1 1;2 2 2;3 3 3;4 4 4],2)
%%%%%%%%%%%%%%%%%%%%%%%%%%%

Y = [];
for i = 1:N:size(matrice,1)
    Y = [Y;sum(matrice(i:i+N-1,:),1)/N];
end
