Hi all,
Say I have the following matrices:
A= [1 2 3 ; 2 3 6]
B= [6 7 7; 4 8 9]
And the user wants to find where are the values (3,8) (3 on the first matrix and 8 on the second matrix) exist at the same index in both.
Is there an efficient built-in function that will return the output of (2,2), which is the location in both matrixes (A and B) that referes to the user's input?
I need to avoid from accidently finding the 3 on (1,3) in A and the 8 on (2,2) in B - even though they meet the same values of the user's input, they are not indexed on the same places in both matrices.
It is only a toy example, the real matrices A and B are huge so running with loops would be very inefficient, hence my question.
In addition, this code should also work and return the same answer if the user's input will be close enough to (3,8), for instance: (2.9,7.9). How can this be implemented?
Thanks!
0 件のコメント
サインインしてコメントする。