next | previous | forward | backward | up | top | index | toc | home

flatten(Matrix) -- puts the columns of a matrix into a single row

Synopsis

Description

flatten f produces a new matrix from f by placing the entries of the columns of f all in a single row, one after the other.
i1 : R = ZZ/101[x,y,z];
i2 : f = matrix {{2, x},{y^2, 23},{z, z^3}}

o2 = | 2  x  |
     | y2 23 |
     | z  z3 |

             3       2
o2 : Matrix R  <--- R
i3 : flatten f

o3 = | 2 y2 z x 23 z3 |

             1       6
o3 : Matrix R  <--- R
Note that this is the matrix given by unnesting the list which was used to enter the matrix.