intersect misses common elements of 2 matrices
Ältere Kommentare anzeigen
I've been using intersect to identify the common elements of two 2D grids. However, when I try it against the following code, it misses some of the common elements.
[x1Grid_1,x2Grid_1] = meshgrid(-70:0.5:70, 1:0.05:17);
xGrid_1 = [x1Grid_1(:), x2Grid_1(:)];
[x1Grid_2,x2Grid_2] = meshgrid(-56:0.5:35, 6:0.05:16);
xGrid_2 = [x1Grid_2(:), x2Grid_2(:)];
[c1,c2,c3] = intersect(xGrid_1,xGrid_2,'rows');
The vector xGrid_2 should be made entirely of elements from xGrid_1. xGrid_2 has 36783 rows, but after running intersect, vectors c1-c3 only have 30195 elements, meaning they miss some of the common elements. I can't understand why this would be happening. Any input would be helpful.
I'm using 2016a.
Thanks, Jack
1 Kommentar
John BG
am 16 Dez. 2016
what are you after, the line intersection of 2 planes?
Akzeptierte Antwort
Weitere Antworten (1)
Jack
am 16 Dez. 2016
Kategorien
Mehr zu Encryption / Cryptography finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!