function R =average(M)
% berechnet spaltenweise das arith. Mittel zweier benachbarter Elemente

%T = zeros(size(M));

%for i=1:length(M)-1
%    T(i,:)=(M(i,:)+M(i+1,:))/2;
%end

%R = T(1:i, :);
%T = [];

k = size(M,1);
R = 0.5*(M(1:k-1,:)+M(2:k,:));