I am trying do address n-dimensional matrices one dimension at a time. If I have (say) a 4x4x4 matrix and want to get the square matrix referenced by matrix(1) = [a 4x4 matrix] I can use matrix(1,:) but this returns a row vector containing all 16 elements that are in the slice, not the shaped matrix. Is there a way to slice an n-dimension matrix (using only the first index) so that a shaped matrix is returned?