Create a linear index with sub2ind, and use it to get the elements you want:
M = randi(99, 3, 2) % Create Matrix linidx = sub2ind(size(M), 1:size(M,1), [1 2 1]) % Linear Index Out = M(linidx)
M =
95 15
49 42
80 91
Out =
95 42 80