I have a two sets of coordinates, and need to exclude one set from the other. Here 'grid' & 'yx' are the two lists. How would I remove all 'xy' coordinates from 'grid'?
x = [1,1,1,1,1,1,2,2,2];
y = [1,1,2,1,1,2,1,1,2];
n = 1:12;
yx = [y',x'];
[gx,gy] = meshgrid(n,n);
gxy=cat(2,gx',gy');
grid = reshape(gxy,[],2);

 채택된 답변

the cyclist
the cyclist 2019년 11월 6일

0 개 추천

I don't quite understand.
Do you mean that if a row from grid also appears as a row in yx, then that row should be removed from grid? If yes, then ...
grid(ismember(grid,yx,'row'),:) = []

댓글 수: 1

Hadley Acrh
Hadley Acrh 2019년 11월 7일
Yes, that is what I was trying to describe. Thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Aerospace Blockset에 대해 자세히 알아보기

질문:

2019년 11월 6일

댓글:

2019년 11월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by