%mathpiper,def="ZeroMatrix"

5  # ZeroMatrix(n_IsNonNegativeInteger) <--  ZeroMatrix(n,n);

10 # ZeroMatrix(n_IsNonNegativeInteger,m_IsNonNegativeInteger) <--
[
  Local(i,result);
  result:={};
  For(i:=1,i<=n,i++)
    DestructiveInsert(result,i,ZeroVector(m));
  result;
];

%/mathpiper



%mathpiper_docs,name="ZeroMatrix",categories="User Functions;Linear Algebra"
*CMD ZeroMatrix --- make a zero matrix
*STD
*CALL
	ZeroMatrix(n)
	ZeroMatrix(n, m)

*PARMS

{n} -- number of rows

{m} -- number of columns

*DESC

This command returns a matrix with {n} rows and {m} columns,
completely filled with zeroes. If only given one parameter,
it returns the square {n} by {n} zero matrix.

*E.G.

In> ZeroMatrix(3,4)
Result: {{0,0,0,0},{0,0,0,0},{0,0,0,0}};
In> ZeroMatrix(3)
Result: {{0,0,0},{0,0,0},{0,0,0}};


*SEE ZeroVector, Identity
%/mathpiper_docs