Matrices and linear algebra
Create matrices in Zlv with [1, 2; 3, 4] or the Matrix Builder (Ctrl+M), then compute determinants, inverses, solve linear systems and inspect results.
Zlv works with matrices and vectors as easily as with numbers. Type them inline, or build them visually with the Matrix Builder.
Writing a matrix
Put the values in square brackets. Separate values in a row with commas and rows with semicolons.
Evaluating…
[1, 2, 3] is a row vector and [4; 5; 6] is a column vector. The nested form [[1, 2], [3, 4]] is accepted too.
Arithmetic
Evaluating…
A * B is matrix multiplication, and A ^ 2 multiplies A by itself.
Matrix functions
Evaluating…
| Function | Result |
|---|---|
det(A) | Determinant |
inv(A) | Inverse |
transpose(A) | Rows and columns swapped |
trace(A), rank(A) | Trace and rank |
eigenvalues(A) | Eigenvalues |
rref(A) | Reduced row echelon form |
solve(A, b) | Solution x of A * x = b |
norm(v), dot(u, v) | Length and dot product |
identity(n), zeros(r, c), ones(r, c) | Special matrices |
reshape(M, r, c), flatten(M) | Change shape |
rows(M), cols(M), dim(M) | Size |
row(M, i), col(M, j) | Extract a row or column |
Solving a linear system
Evaluating…
Building, reshaping and indexing
Indexes start at 1: A[1, 2] is row 1, column 2.
Evaluating…
The desktop engine adds cross, diag, vector indexing and random matrices:
Results appear next to each line in Zlv Desktop. Download it free.
Matrix Builder (desktop)
Press Ctrl+M (or search for Matrix Studio with Ctrl+K) to open the Matrix Builder.
- Enter a Name, such as
A. - Set Rows and Cols, from 1 to 8 each.
- Pick a preset to fill the grid: Custom, Zeros, Ones, Identity, Diagonal, Sequential, Random Int (1..9) or Random Float (0..1). Edit any cell by hand.
- Click Insert Matrix to add it at the cursor, or New Matrix Page to open it in a new tab.
Copy Code copies the Zlv matrix literal and Copy LaTeX copies it for use in documents.
Matrix Inspector (desktop)
Click a matrix result to open the 2D Matrix Inspector, which shows the matrix as a grid with its shape. From there you can copy it as Zlv code, CSV, LaTeX or a NumPy array.