MATLAB: Check if matrix has two identical rows

MATLABmatrixmatrix manipulation

Hi everyone, I wanted to check if a matrix has two identical rows. But i cant create a code that can do that. I was wondering if anyone has any idea on how to do that?

Best Answer

If you want to remove identical rows, then
B = unique(A,'rows');
As a check, if size(B) ~= size(A), then you have at least two identical rows.