finding similar rows in matrices
Ältere Kommentare anzeigen
Hi, i have several matrices that has 3 columns each, but the number of rows is not equal. im trying to find a fast way of comparing the first two columns in all 3 matrices and to find the rows (column 1 and 2) that are identical in all 3 of them. i've tried "ismember", it works ok but when dealing with lots of matrices its too slow.
can anyone recomend a different function? thank you for your help.
3 Kommentare
the cyclist
am 11 Feb. 2014
Can you post an example of your code, as well as some sample input/output that you expect? This will save a lot of guesswork on our part.
Dany
am 11 Feb. 2014
Bearbeitet: the cyclist
am 11 Feb. 2014
SIVAKUMAR KARURNKARAN
am 24 Apr. 2015
thankyou sir i have one doubt in my coding.how to remove a duplicate matrices in the set of all matrices.
Akzeptierte Antwort
Weitere Antworten (2)
Jos (10584)
am 11 Feb. 2014
INTERSECT or ISMEMBER come into mind:
tf = ismember(C, A(ismember(A,B,'rows')), 'rows')
result = C(tf,:)
Dany
am 11 Feb. 2014
0 Stimmen
Kategorien
Mehr zu Matrix Indexing 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!