Hello, I'am trying to solve what seems a simple problem. Looked around and there's plenty of suggestions but just can't manage to get it right. Here's the problem, I have a matrix of coordinates x and y, in which the data is given by the user. So I need a way of comparing rows to tell the user if two points have same coordinates.
cord=[0,0;
1,0;
2,0;
0,0;
1,0.75;
2,0.75]
So in this matrix row 1 and row 4 are the same so I would need any way of saying if this happens any number of times show error.

1 Kommentar

per isakson
per isakson am 13 Nov. 2014
Bearbeitet: per isakson am 14 Nov. 2014
Did you try &nbsp [C,ia,ic] = unique(A,'rows') &nbsp followed by &nbsp histc(ia) ?

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 13 Nov. 2014

0 Stimmen

[x,idx]=unique(cord,'rows')

Weitere Antworten (0)

Kategorien

Community Treasure Hunt

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

Start Hunting!

Translated by