Suppose I want do something similar to
image(1:end-1,2:end,:)
which here is taking part of colored image
but with unknown number of dimensions, i.e. which will work automatically like
image(1:end-1,2:end)
for 2 dimensions
image(1:end-1,2:end,:)
for 3 and
image(1:end-1,2:end,:,:)
for 4 and so on.