Reputation: 110
For example, if a matrix is
A = [11 22 33 11; ...
44 55 66 34; ...
67 45 33 22]
then from each row I want to pick
col_idx = [2 4 1]
so that the result would be
ans = 22
34
67
Other questions similar to this are based on R or Python. However, I am looking for a MATLAB based answer. Any help would be appreciated.
Upvotes: 0
Views: 52