I have two matrices, the A1 (270X1) and the A2 (171X1). Matrix A2 has some values, which are the same as some of matrix A1. What I want is to find in which positions matrix A1 has the same values as matrix A2. Below I have the code I wrote but the issue is that in k1 there is the position of the last same value that the two matrices have. There are no other positions for all other same values.
Your help is invaluable !!