Or more? How many more dimensions? Really high dimensional arrays will be huge, so it makes little sense to have a 300 dimensional array. Even a 2- dimensional array actually has infinitely many trailing singleton dimensions. So a 5x6 array is actually implicitly of size
[5,6,1,1,1,1,1,1,1,1, ...
Suppose you are willing to assume your array will have no more than 5 dimensions in the future. Then the trivial solution is:
SumOverColumns = sum(Array2D(:, 2:end, :, :, :), 2);
There are ways to do this with more potential dimensions, but why bother?
Best Answer