I know this is a simple question, but I cant seem to find answers on this.
Given a 2D matrix of any size and a vector of indices, I want to index the elements in the matrix based on the column indices values in order.
Eg.matrix = [1 2 3 4 5 6 7 8 9] column indices = [1,3,1]Output = [1,6,7] -> column index 1 = 1, column index 3 = 6, column index 1 = 7
Best Answer