CoCoA:MakeMatByRows, MakeMatByCols

From ApCoCoAWiki

MakeMatByRows, MakeMatByCols

convert a list into a matrix

Description

These functions convert the list L into a matrix.

The first argument is the number of rows and the second the number of columns.

Example

  MakeMatByRows(2, 10, 1..20);
Mat([
  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
  [11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
])
-------------------------------
  MakeMatByCols(2, 10, 1..20);
Mat([
  [1, 3, 5, 7, 9, 11, 13, 15, 17, 19],
  [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
])
-------------------------------

Syntax

MakeMatByRows(R:INT, C:INT, L:LIST):MAT
MakeMatByCols(R:INT, C:INT, L:LIST):MAT

BlockMatrix

Mat

NewMat

ColMat

RowMat

DiagonalMat

MatConcatHor

MatConcatVer

   <type>list</type>
   <type>matrix</type>