Filter löschen
Filter löschen

Remove duplicated rows in a matrix

2 Ansichten (letzte 30 Tage)
Mani Ahmadian
Mani Ahmadian am 25 Sep. 2014
Bearbeitet: Michael Haderlein am 25 Sep. 2014
Hi
I have some (x,y) points and it consists of some duplicated values, for example (x3,y3) is duplicated 3 times in data. How I can find/remove this point and other duplicated points in all my data?
Thanks.
Mani

Antworten (1)

Michael Haderlein
Michael Haderlein am 25 Sep. 2014
Bearbeitet: Michael Haderlein am 25 Sep. 2014
unique(array,'rows') can do the job:
>> A=[1 2;3 4;5 6;1 2]
A =
1 2
3 4
5 6
1 2
>> unique(A,'rows')
ans =
1 2
3 4
5 6

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by