Karim Belabas on Mon, 25 Jun 2012 18:39:10 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Making a vector from a matrix


* Dirk Laurie [2012-06-25 13:33]:
> What are the recommended ways of:
> 
>     1. Making a column out of a one-column matrix (trivial in library mode but
>         what about GP?)

  M[,1]

>     2. Making a vector out of all the elements of a matrix, row-wise

  concat( Col(M)~ )


>     3. Making a vector out of all the elements of a matrix,column-wise

  concat( Vec(M) )~

Cheers,

    K.B.
-- 
Karim Belabas, IMB (UMR 5251)  Tel: (+33) (0)5 40 00 26 17
Universite Bordeaux 1          Fax: (+33) (0)5 40 00 69 50
351, cours de la Liberation    http://www.math.u-bordeaux1.fr/~belabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux1.fr/  [PARI/GP]
`