Check if matrix has two identical rows

조회 수: 33 (최근 30일)
Raldi
Raldi 2012년 1월 4일
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?

채택된 답변

Dr. Seis
Dr. Seis 2012년 1월 4일
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.

추가 답변 (1개)

Sean de Wolski
Sean de Wolski 2012년 1월 4일
doc unique
specifically look at the 'rows' option.

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by