[ library(matrix_util) | Reference Manual | Alphabetic Index ]

transpose(+Matrix, -Transposed)

Transpose a matrix (list of rows or list of columns)

Examples

    ?- list2rows([1,2,3,4,5,6],2,3,Rows), transpose(Rows,Cols).
    Rows = [[1, 2, 3], [4, 5, 6]]
    Cols = [[1, 4], [2, 5], [3, 6]]
    Yes (0.00s cpu)