powered by
Performing to matrices tensorisation, which is the inverse process of unfolding
refold(unfolding, k, dim_vec)
A multi-dimensional array
A matrix.
An integer specifying the mode of array to refold from.
A vector specifying the expected dimension of output array.
refold(matrix(1:9,nrow=3), 1, c(3,1,3));
Run the code above in your browser using DataLab