How to compare rows in same matrix

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 件のコメント

per isakson
per isakson 2014 年 11 月 13 日
編集済み: per isakson 2014 年 11 月 14 日
Did you try &nbsp [C,ia,ic] = unique(A,'rows') &nbsp followed by &nbsp histc(ia) ?

サインインしてコメントする。

 採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 11 月 13 日

0 投票

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

1 件のコメント

Alejandro
Alejandro 2014 年 11 月 14 日
Thanks!! for the help

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

質問済み:

2014 年 11 月 13 日

コメント済み:

2014 年 11 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by