A program that finds the same coordinate

Hi,
Could someone help me find a program or function that checks if there is a matching coordinate pair in this coordinate list?
The matrix used are like this one.
XY = [0 0;
1 0;
2 0;
3 0;
0 -1;
1 -1;
2 -1;
3 -1];
Thank you so much!

1 件のコメント

Tommy
Tommy 2020 年 4 月 20 日
If you are perhaps looking to compare pairs of coordinates, rather than compare the values within each pair:

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

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 4 月 20 日
編集済み: Ameer Hamza 2020 年 4 月 20 日

1 投票

Something like this
XY = [0 0;
1 0;
2 0;
3 0;
0 -1;
1 -1;
2 -1;
3 -1];
mask = XY(:,1)==XY(:,2);
matching_pairs = XY(mask, :);
Result:
matching_pairs =
0 0

その他の回答 (0 件)

カテゴリ

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

製品

リリース

R2019b

質問済み:

2020 年 4 月 20 日

コメント済み:

2020 年 4 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by