I have a 2D array, "A":
>> A = reshape([1:25],5,5)A = 1 6 11 16 21 2 7 12 17 22 3 8 13 18 23 4 9 14 19 24 5 10 15 20 25
and I have coordinate pairs (x,y) stored in array "B":
>> B = [ 1 1; 2 2; 3 3]B = 1 1 2 2 3 3
How can I use "B" to access "A" such that I get something like:
>> A(B)ans = 1 3 7
Best Answer