From: Matt Fig on
One approach:

B = A([true;logical(diff(A(:,2)))],:)