I have as entry a matrix which can have an several number of dimensions : n × m
or n × m × p
or n × m × p × q
or ...
What I want to do is to access to the last dimension, something like:
data = input(:,:,1)
The problem is that the number of :
can change.