When I input a value of N, a N-dimensional matrix is generated automatically. I want to index automatically the N-dimensional matrix based on the value of N.
For example, if the dimension of the matrix A is 3:
temp = A[a + 1, a + 2, a + 3]
If it is 4:
temp = A[a + 1, a + 2, a + 3, a + 4]
Because my entire code generates many matrices with various dimenstions through the value of N, I seek ways that meet my needs.
Thanks.