linalg(deprecated)
randmatrix
random matrix generator
Calling Sequence
Parameters
Description
Examples
randmatrix(m, n, options)
m, n
-
positive integers
options
(optional) names or equations
Important: The linalg package has been deprecated. Use the superseding command LinearAlgebra[RandomMatrix], instead.
- For information on migrating linalg code to the new packages, see examples/LinearAlgebraMigration.
The randmatrix function generates a random matrix of dimension m by n. It is intended to be used for generating examples for debugging, testing, and demonstration purposes. Several options are available. The options determine the form of the matrix and the entries in the matrix.
The first two arguments specify the row dimension and column dimension. The remaining arguments are interpreted as options and are input as equations or names in any order. The names sparse, dense (default), symmetric, antisymmetric, and unimodular specify the structure of the matrix. The equation entries = f specifies that the nullary function f is to be used to generate the matrix entries. The default is rand(-99..99). Thus the matrix entries are random two digit integers.
The command with(linalg,randmatrix) allows the use of the abbreviated form of this command.
with⁡linalg:
randmatrix⁡3,3
−722−55−9487−560−6297
randmatrix⁡3,3,unimodular
1−73−401−83001
poly := proc() Randpoly(3, x) mod 3 end proc;
poly ≔ procRandpoly⁡3,xmod3end proc
randmatrix⁡2,2,entries=poly
x3+x2+2⁢x+12⁢x3+2⁢x2+12⁢x3+x+12⁢x3+x2+x
See Also
linalg(deprecated)[matrix]
LinearAlgebra
LinearAlgebra[RandomMatrix]
Matrix
Download Help Document