I have a matrix A 151x1 double and a matrix B 151x1000 double. Each value of A corresponds to a certain value in the same row of B. For example if A=22;14;53;2, then B will have the value 22 in one of its columns in the first row, the value 14 in one of its columns in the second row etc. Is there a way to have the matrix of the index of all the columns in B that contain the values of A (always in their coresponding row?).