Takes a vector of integers (1D linear indexed) and converts them to matrix
subscripts in n-dimensional matrix. Modeled after MATLAB's ind2sub()
ind2subs(ind, dims)
An integer vector with linear indexes
An n-dimensional integer vector. Each element of this vector indicates the size of the corresponding dimension in the n-dimensional matrixc.
A list of n lists of equal length. Each list corresponds to one of the n dimensions of the matrix. Rows indicate subscripts. Suitable for use with mapping functions.