I have a matrix A
of size nRows x nCols.
I have a nx2
matrix B
which contains indices of the matrix A
.
I want to get the values of A
at the indices given in B
.
lets say,
B = [1, 2;
2, 3;
3, 4]
A(1,2) = 1
A(2,3) = 2
A(3,4) = 1
I want to know any Matlab command which gives the following, given A
and B
(I don't want to use loops):
[1 2 1]