Return a pseudo random matrix of a given kind, type and size
Contributed by:
Dennis M Schneider
Examples
Basic Examples (7) 
A random 2×3 real matrix whose entries are approximate real numbers between 0 and 1:
A random 2×3 real matrix whose entries are approximate real numbers between -5 and 10:
A random 2×3 real matrix whose entries are integers between -5 and 10:
A random 2×3 real matrix whose entries are rationals between -5 and 10:
A random 2×3 real matrix whose entries are Gaussian integers between -5 and 10:
A random 2×3 real matrix whose entries are Gaussian rationals between -5 and 10:
A random 2×3 complex matrix whose entries are RandomComplex[{-5+2I,10-3I}]:
Scope (23) 
Examples of special kinds of square matrices:
Triangular (1) 
A random 4×4 upper triangular matrix with integer entries:
Symmetric (3) 
A random 5×5 symmetric matrix with integer entries having rank 3:
Check:
A random 3×3 symmetric matrix with integer entries:
Check:
A random 3×3 symmetric matrix with approximate real entries:
Check:
Skew-Symmetric (2) 
A random 3×3 skew-symmetric matrix with integer entries:
Check:
A random 5×5 skew-symmetric matrix with rationals entries having rank 3:
Check:
Hermitian (2) 
A random 4×4 Hermitian matrix with Gaussian integer entries:
Check:
Skew-Hermitian (2) 
A random 4×4 skew-Hermitian matrix with integer entries:
Check:
Involution (skew reflection) (2) 
A random 4×4 involution matrix with integer entries; geometrically these matrices represent (not necessarily orthogonal) reflections:
Check:
Symmetric Involution (reflections) (2) 
A random 4×4 symmetric involution with integer entries (geometrically these matrices represent orthogonal reflections in the column space of the matrix):
Check:
Symmetric Idempotent (orthogonal projections) (4) 
A random 4×4 symmetric idempotent with integer entries (geometrically these matrices represent orthogonal projections onto the column space of the matrix):
Check:
A projection onto a two dimensional subspace (its column space):
Check:
Idempotent (skew projections) (2) 
A random 5×5 idempotent with integer entries (geometrically these matrices represent skew or oblique projections onto the column space of the matrix):
Check:
Orthogonal (1) 
Check:
Unitary (2) 
A random 4×4 unitary matrix with Gaussian integer entries:
Check:
A random 4×4 unitary matrix with complex entries:
Check:
Publisher
Dennis M Schneider
Version History
-
2.0.0
– 21 August 2023
-
1.0.0
– 08 January 2021
Related Resources