필터 지우기
필터 지우기

A program that finds the same coordinate

조회 수: 2 (최근 30일)
Marco Camozzi
Marco Camozzi 2020년 4월 20일
댓글: Tommy 2020년 4월 20일
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일
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에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by