matthiasm@8: function lm = localmax_logical(mat,n) matthiasm@8: matthiasm@8: diffmat = [mat(1,:)*0; sign(diff(mat))]; % !!!! attention rethink the 0!!!!! matthiasm@8: convolver = -[ones(n,1);-ones(n,1)]; matthiasm@8: lm = conv2(diffmat,convolver,'same') == 2 * n;