--- title: Matrix description: "Learn how to build custom functionality when working with the React Spreadsheet by Kendo UI with the help of the Matrix." api_reference: true type: inner_api slug: api_spreadsheet_matrix --- # Matrix The "matrix" type which can be used in the custom JavaScript functions (primitives) in formulas.
| Name | Type | Default | Description |
|---|---|---|---|
| #### height |
number
|
Indicate the height of the matrix. | |
| #### width |
number
|
Indicate the width of the matrix. |
(context: [Context]({% slug api_spreadsheet_context %}))
#### Parameters
##### context
[Context]({% slug api_spreadsheet_context %})
## Methods
| #### clone | ||||
|---|---|---|---|---|
| Returns a new matrix with the same data. | ||||
|
| #### determinant | ||||
|---|---|---|---|---|
| Returns the determinant of this matrix. The matrix should contain only numbers and be square. Note that there are no checks for this. | ||||
|
| #### each | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Iterates through elements of the matrix and calling the `func` for each element (first columns, then rows). | |||||||||
|
| #### get | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Returns the element at a given location. | |||||||||
|
|||||||||
|
| #### inverse | ||||
|---|---|---|---|---|
| Returns the inverse of this matrix. The matrix should contain only numbers and be square. Note that there are no checks for this. If the inverse does not exist, the determinant is zero, then it returns `null`. | ||||
|
| #### map | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Similar to `each`, but produces a new matrix of the same shape as the original one with the values returned by the function. | |||||||||
|
|||||||||
|
| #### multiply | ||||||
|---|---|---|---|---|---|---|
| Multiplies the current matrix by the given matrix, and returns a new matrix as the result. | ||||||
|
||||||
|
| #### set | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Sets the element at a given location. | ||||||||||||
|
| #### transpose | ||||
|---|---|---|---|---|
| Returns the transposed matrix. The rows of the original matrix become columns of the transposed one. | ||||
|
| #### unit | ||||||
|---|---|---|---|---|---|---|
| Returns the unit square matrix of size `n`. | ||||||
|
||||||
|