How to find the intersection points in a multidimensional array
23 ビュー (過去 30 日間)
古いコメントを表示
A=4X2X10;B=4X2X10;(array size of A and B) how to find intersect points between A and B eg like this _ _ *
I=(4X2X10)(array size of I)
I=intersect(A(:,:,1),B(:,:,1),'rows'
for eg A(:,:,1)=[4 5; 7 8;1 0; 6 3] and B=(:,:,1)=[8 9;4 5;2 8;6 3] I(:,:,1)=[4 5;6 3]
0 件のコメント
回答 (1 件)
KSSV
2020 年 11 月 22 日
Read about ismember. You can use ismemebrfor each marix by running a loop. For the present given matrices:
A (:,:, 1) = [4 5; 7 8; 1 0; 6 3];
B (:,:, 1) = [8 9; 4 5; 2 8; 6 3];
[c, ia] = ismember (A, B, 'rows' );
I = A (c, :)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Operators and Elementary Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!