How to transpose a matrix with the following output:
[3] [ 7 , 1] [ 5 , 8, -1]
to :
[ 3 7 5 2] [1 8 -9] [-1 5