Check if matrix has two identical rows

33 visualizzazioni (ultimi 30 giorni)
Raldi
Raldi il 4 Gen 2012
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?

Risposta accettata

Dr. Seis
Dr. Seis il 4 Gen 2012
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.

Più risposte (1)

Sean de Wolski
Sean de Wolski il 4 Gen 2012
doc unique
specifically look at the 'rows' option.

Categorie

Scopri di più su Resizing and Reshaping Matrices in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by