function Z = glatting(Y) n = length(Y); % size(Y,2) også OK Z(1) = Y(1); Z(n) = Y(n); for i = 2:n-1 Z(i) = (Y(i-1) + Y(i) + Y(i+1)) / 3; end end