Structured Matrix Generator
Create deterministic n×n matrices with specific mathematical properties: symmetric, positive-definite, covariance, correlation, confusion, adjacency, rotation, or sparse matrices.
Also known as: random matrix · matrix generator
seeded · synthetic data
Presets
Output
About this tool, tips & examples
What it does
The Structured Matrix Generator produces n×n matrices with guaranteed mathematical properties: symmetric, positive-definite, covariance, correlation, confusion (classification), adjacency (graphs), rotation (transformations), or sparse. Up to 12×12 at configurable precision — matrices whose structure your algorithm can rely on, regenerable from a seed.
Common use cases
- Linear algebra testing — Cholesky decomposition needs positive-definite input; eigensolvers behave differently on symmetric matrices. Get valid input by construction (presets for symmetric, correlation, and sparse).
- Statistics code — covariance and correlation matrices with the right invariants (unit diagonal, symmetry) for testing estimators and samplers.
- ML evaluation tooling — confusion matrices for testing precision/recall/F1 calculations and heatmap displays.
- Graphics and graphs — rotation matrices for transform code, adjacency matrices for graph algorithms.
Settings
- Matrix Type — one of the eight structures above.
- Matrix Size — 1×1 to 12×12.
- Decimal Places — 0 to 6.
- Seed — identical seed + settings = identical matrix, exportable as CSV, JSON, or TSV.
Privacy note
Matrices are computed locally in your browser; nothing is uploaded — pure synthetic linear algebra.
FAQ
Why does the structure matter? Many algorithms have preconditions: Cholesky fails on non-PD input, correlation math assumes unit diagonals. Random matrices almost never satisfy these — constructed ones always do, so your tests exercise the algorithm, not the input validator.
Are the properties exact? They’re built in by construction (then rounded to your precision — at very low precision, verify tolerance-sensitive properties like positive definiteness downstream).
Bigger or non-square matrices? The plain Random Matrix generator does up to 500×500 rectangular; the N-Dimensional Array tool goes beyond two dimensions. This tool trades size for structure.