I have a 2-D array. And I want to access it with rows and colums index stored in another 2-D array. Example: Now I don't want to use loops but I want to access A(1, 2) and A(3, 4).
A = ones(10,10)
B = [1, 2 ; 3, 4]
If I do A(b(:,1), b(:,2))
, this will result in all possible combination of [1,2] and [3,4].
How can it be done?