powered by
Unfold/Matricize tensor. convert matrix to tensor by mode.
unfold(tensor, mode)
Matrix
Three-mode tensor array.
Mode of operation.
X_i_jk = generate_dataset()$X_i_jk X_i_j_k = fold(X_i_jk, mode=1, shape=c(I=8,J=5,K=4)) unfold(X_i_j_k, mode=1) # X_i_jk
Run the code above in your browser using DataLab