function Am=appendmirror(A) %APPENDMIRROR append the mirrored matrix rows before and after % Am = APPENDMIRROR(A) build to the rows of A % the left and right A mirrors, one before and the other after % the resulting array/matrix length is 3*length(A) % Useful for filtering or resampling functions % % Author(s): F. Patanč, 2000 l=size(A,1); Afl=flipud(A); Abeg=repmat(2*A(1,:),[l,1])-Afl; Aend=repmat(2*A(end,:),[l,1])-Afl; Am=[... Abeg(1,:);... Abeg((1:(end-1)),:);... A;... Aend((2:end),:);... Aend(end,:)... ];