I would use the sub2ind (link) function. I am not certain you could do it in one line, but you can get close.
Example —
M = randi(99, 4, 4, 3);
LinIdx = sub2ind(size(M), [1 2], [3 4], [2 3]);
Result = M(LinIdx);
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!