Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How can I check each elements when it one row and two columns with list of all the x and y coordinates.

1 回表示 (過去 30 日間)
Mohammed Alammar
Mohammed Alammar 2019 年 12 月 28 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi,
I have list of the y and x coordinates which I have called it 'coords'. Also, I have another list 'S' that contains list of x and y coordinates but this list bigger than the first one due to contain some the y and x coordinates in or out of the first list ' coords'. as shown in the attachments.
**what I am looking, to check each coordinats y x from the second list 'S' with the first list 'coords':
When any S(1:length(S) , 2) = = any coords(1:length(coords), 2)
-Save the first coordinates y x from the S list coordinates in S ( as a first element) and ignoor the others.
When S(1:length(S) , 2) not = any coords(1:length(coords), 2)
-Save the first coordinates y x from the S list coordinates in S (as a second elements) and ignoor the others.

回答 (1 件)

Image Analyst
Image Analyst 2019 年 12 月 28 日
Use ismember()
  1 件のコメント
Mohammed Alammar
Mohammed Alammar 2019 年 12 月 29 日
編集済み: Mohammed Alammar 2019 年 12 月 29 日
Dear,
Thank you for reply. I have used this but not worked because it was checked each column separately.
Lia = ismember(S(:,:),coords(:,:));
d = find(Lia==1,1,'first');
S(1,:)= S(d,:);
d = find(Lia==0,1,'first');
S(2,:)= S(d,:);
could you please help me

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by