Probably easy to write, but if there is an existing efficient implementation then I'd like to use it.
My application is that I have an array A, of which I do not know the dimensionality beforehand. Hence I loop
for n = 1:length(A)
. . .
end
but can still access the multi-index corresponding to n inside the loop.
Thank you,
Christoph