up previous next
NewMat

create a new matrix

Syntax
NewMat(R:RING, M:INT, N:INT):MAT
NewMat(M:INT, N:INT, Val:RINGELEM):MAT

Description
The second function returns an MxN matrix, filled by Val. The first function, in which Val is not indicated, returns an MxN matrix filled with "zero(R)" values.

Example
/**/  Use S ::= QQ[x,y,z];
/**/  NewMat(S,2,3);
matrix([
  [0, 0, 0],
  [0, 0, 0]
])

/**/  NewMat(2,3, RingElem(QQ,4));
matrix([
  [4, 4, 4],
  [4, 4, 4]
])

See Also