I have a 2x2 matrix "M", and a list "ind" containing pairs of indices.
M = {{a, b, c}, {d, f, g}, {h, i, j}};
ind = {{1, 2}, {1, 1}, {3, 1}};
I would like to get the elements of the matrix given by the indices in "ind", in this case:
{b,a,h}
The only way I've found to do this is with MapThread:
MapThread[M[[#1, #2]] &, ind\[Transpose]]
However, the matrices and lists I am using are quite large, and this takes considerable time. Is there a more efficient way to do this? Can this be parallelized (maybe by using ParallelMap, instead of MapThread)?
M[[Sequence @@ #]] & /@ ind
and Welcome to the Mathematica Stack Exchange. $\endgroup$