You can create and calculate using matrices in the Desmos Graphing Calculator, Geometry Tool, 3D Calculator, and Notebook.
Watch the video for an introduction to using Matrices in Desmos, and read on to learn more.
Matrices are a new feature, so if you run into any bugs, please reach out to us at support@desmos.com.
Create a Matrix
To create your first matrix, enter matrix in a new expression line. This will generate a new 2x2 matrix filled with zeros. Click, tab, or use your arrow keys to move between cells to fill in your own values.
To define a new matrix with specific dimensions, you can use the syntax \(\mathbf{\#ab}\), where \(a\) is the number of rows, and \(b\) is the number of columns. For example, typing \(\mathbf{\#43}\) will create a 4x3 matrix.
To add or remove rows and columns to your matrix, click and drag the corner , or tab to the corner and then use your arrow keys to adjust.
Matrix Operations and Syntax
You can perform operations on a matrix directly or by referencing matrices defined by variables. You can multiply by a scalar or another matrix, add or subtract matrices, or find inverses.
Some matrix functions require specific conditions. For example, multiplied matrices must have compatible dimensions, you can only find the determinant of square matrices, and you can’t invert a singular matrix.
You can use additional commands to extract elements of your matrix or to define new matrices.
To extract the single element in row \(a\) and column \(b\) of a matrix \(M\), use the syntax \(\mathbf{M[a;b]}\). For example, typing \(\mathbf{M[2;3]}\) will return the element in the second row and third column.
You can call multiple rows or columns at a time using this syntax using commas, and if you leave one of these elements blank, the calculator will return the full row or column.
Alternatively, you can extract entire rows or columns using the syntax rows\(\mathbf{(M)}\) or columns\(\mathbf{(M)}\).
To create a matrix with a specific structure, you can use list comprehension.
Take the following expression as an example: \(a+b\) for \(a=[1…3];b=[1…4].\)
By separating the two variable lists with a semicolon, the calculator recognizes this expression as a matrix. The first list designates the number of rows, and the second indicates the number of columns. The initial expression, \(a+b\), determines the value assigned to each position in terms of row and column.
You can use this strategy to create an identity matrix by assigning ones for the diagonal where the row and column numbers are the same.
More Ways to Use Matrices
Points
You can multiply a matrix with appropriate dimensions by a 2D or 3D point to transform it, so you can rotate, scale, or reflect points. Explore our Matrix Point Transformations example graph.
Supported Functions
| Function | Try typing... | This function... |
|---|---|---|
| determinant | det\(\mathbf{(A)}\) | calculates the determinant of a square matrix. |
| trace | trace\(\mathbf{(A)}\) | calculates the sum of the diagonal of a square matrix. |
| reduced row echelon format | rref\(\mathbf{(A)}\) | reduces a matrix to row echelon form. |
| rank | rank\(\mathbf{(A)}\) | calculates the maximum number of linearly independent rows or columns of a matrix. |
| rows | rows\(\mathbf{(A)}\) | returns a list of row matrices. |
| columns | columns\(\mathbf{(A)}\) |
returns a list of column matrices. |
| transpose | \(\mathbf{A^{T}}\) | switches the rows and columns of a matrix. |
| matrix template |
matrix |
creates a 2x2 matrix. |
| hash |
\(\mathbf{\#24}\) |
creates a matrix with the given row and column dimensions. So, \(\#24\) will give a 2x4 matrix. |
| semicolon |
\(\mathbf{A[2;4]}\) |
separates a matrix row and column dimensions when referencing a matrix element, column, or row. So, \(A[2;4]\) will give the entry in the second row and fourth column of the matrix. |
| inverse | \(\mathbf{A^{-1}}\) | finds the inverse of a non-singular, square matrix. |
Learn More
- Solving Systems with Matrices - Example Notebook
- Matrix Point Transformations - Graphing Calculator
- Lists
Please write in with any questions or feedback to support@desmos.com.