From: Robert on
Hi all,

I am trying to remove rows which contains duplicates elements.

For e.g.:

X=[ 1 2 3 1 1;
2 1 2 2 3;
4 1 2 4 3;
1 2 3 4 5;
]

Should return

Xr = [1 2 3 4 5], as 1 2 3 4 5 is the only row where all elements are distinct

Do you know a fast way to do it ?

In my approach I loop with a for all the rows and check if unique(rows(i,:)) == 5 add to Xr.


But I have to test for large test of data and this for loop is very time consuming.

Is any possibility to do it faster ?

I will appreciate any advice.

Thanks,
Robert