I am trying to index a matrix (image read with imread()
) with vectors for row
and column
numbers.
map
is the image read with imread()
, and rows
and columns
are the 1-dimensional index vectors.
But when I do map(rows, columns)
it returns a 2-dimensional matrix, where I presume it is using every single permutation of rows
and columns
to index map
.
How do I index map
with each corresponding element at (rows,columns)
?
I believe the answer I am looking for is equivalent to diag( map(rows,columns )
but it's a bit inefficient I think.