I have an array comprising n rows and 4 colums. Each of the four entries on the row is an integer, i.e.,
X = [
111 112 432 2
6 9 115 111
112 432 111 2
];
Each row represents the vertices of a tetrahedron. These vertices have no directionality thus, in the case above, the tetrahedra represented by X(1,:) and X(3,:) are equivalent.
I wish to remove duplicate tetrahedra from X, but can't quite figure how to incorporate the order independence into my code.
I tried the UNIQUE() function but this returns a (nx1) array of unique integers, i.e.,
Y = UNIQUE(X);
Y = [
2
6
9
111
112
115
432
]
Anyone have any suggestions for a reasonably efficient way to complete this task?
Thanks,
S :-)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…