What is the Fastest manner to match rows of 2 matrices?

Illustration
Ottosaul - 2020-12-24T12:56:16+00:00
Question: What is the Fastest manner to match rows of 2 matrices?

I have 2 large matrices (S1, S2) with matching rows I used    [~,index_A,index_B] = intersect( S1',S2', 'rows'); But it is very time consuming. Is there a faster way to do this?

Expert Answer

Profile picture of John Michell John Michell answered . 2025-11-20

No, not unless, possibly, the columns of S1 and S2 are sorted in some way or have some additional structural properties.


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!