Macaulay2 » Documentation
Packages » Macaulay2Doc » matrices » random and generic matrices » genericMatrix
next | previous | forward | backward | up | index | toc

# genericMatrix -- make a generic matrix of variables

- Usage:
    `genericMatrix(R,r,m,n)`
- Inputs:
  - R, a ring
  - r, a ring element, which is a variable in the ring R (this input is optional)
  - m, an integer
  - n, an integer
- Outputs:
  - a matrix, with m rows and n columns whose entries are variables in the ring R starting with r

## Description

    i1 : R = ZZ[a..z];

    i2 : genericMatrix(R,a,2,4)

    o2 = | a c e g |
         | b d f h |

                 2      4
    o2 : Matrix R  <-- R

    i3 : genericMatrix(R,i,3,2)

    o3 = | i l |
         | j m |
         | k n |

                 3      2
    o3 : Matrix R  <-- R

Omitting the input r is the same as having r be the first variable in R.

    i4 : genericMatrix(R,2,4)

    o4 = | a c e g |
         | b d f h |

                 2      4
    o4 : Matrix R  <-- R

    i5 : genericMatrix(R,3,2)

    o5 = | a d |
         | b e |
         | c f |

                 3      2
    o5 : Matrix R  <-- R

## See also

- vars(Ring) -- row matrix of the variables
- genericSkewMatrix -- make a generic skew symmetric matrix of variables
- genericSymmetricMatrix -- make a generic symmetric matrix

## Ways to use genericMatrix:

- `genericMatrix(Ring,RingElement,ZZ,ZZ)`
- `genericMatrix(Ring,ZZ,ZZ)`

## For the programmer

The object genericMatrix is a method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/functions/genericMatrix-doc.m2:35:0.