I have an indexing problem in Matlab. Let's say that I have a m-dimensional array A with m depending on the problem.
Suppose I have vector with indices
x = [i2, ..., im]
and I want to take the vector
A(:, i_2, ..., i_m)
. If m is constant in all cases, it is not that difficult. You can just say
i_j = x(j), j = 2, ..., m
. Is it possible to do this without an if-loop (so without saying 'if m == 2 then .. if m == 3 then ...' and so on )?
Thanks for the help