CoCoA:Mat
From ApCoCoAWiki
Mat
convert an expression into a matrix
Description
This function converts the expression E into a matrix. The first form
is equivalent to Cast(E,MAT).
Example
Use R ::= Q[x,y]; L := [[1,2],[3,4]]; Mat(L); Mat([ [1, 2], [3, 4] ]) ------------------------------- M := Module([x,x^2,y],[x^2,y,0]); Mat(M); Mat([ [x, x^2, y], [x^2, y, 0] ]) ------------------------------- Mat([[1,2],[3,4]]); Mat([ [1, 2], [3, 4] ]) ------------------------------- Mat[[1,2],[3,4]]; -- only square brackets is obsolescent! Mat([ [1, 2], [3, 4] ]) ------------------------------- -- a slightly more obscure example: allowed, but discouraged! M := Mat([[<quotes>a</quotes>,<quotes>b</quotes>],[<quotes>c</quotes>,[1,2]]]); N := Mat([[<quotes>d</quotes>,<quotes>e</quotes>],[<quotes>f</quotes>,[3,4]]]); M+N; Mat([ [<quotes>ad</quotes>, <quotes>be</quotes>], [<quotes>cf</quotes>, [4, 6]] ]) -------------------------------
Syntax
Mat(E):MAT Mat[E]:MAT -- obsolescent! where E is either: a <em>rectangular</em> lists of lists, a vector, or a module.
<type>list</type> <type>matrix</type> <type>vector</type>