A program that finds the same coordinate

2 次查看(过去 30 天)
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!

采纳的回答

Ameer Hamza
Ameer Hamza 2020-4-20
编辑:Ameer Hamza 2020-4-20
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 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by