


![[top]](top.gif)
genericMatrix(R,x,m,n) -- produce an m by n matrix of variables drawn from the ring R, starting with variable x.
i1 : R = ZZ/101[a..d] |
i2 : genericMatrix(R,a,2,2) |
Code:
-- ../../../Macaulay2/m2/genmat.m2:9-15
genericMatrix = (R,first,nrows,ncols) -> (
first = getIndex(R,first);
if not instance(nrows,ZZ) or not instance(ncols,ZZ) or nrows < 0 or ncols < 0
then error "expected nonnegative integers";
if first + nrows * ncols > numgens R
then error "not enough variables in this ring";
matrix table(nrows, ncols, (i,j)->R_(first + i + nrows*j)))



![[top]](top.gif)