# dimensions function

The size of a list or a matrix, level by level.

## How to write it

### dimensions(list)

**list**

A list, or a matrix. Takes a list.

## Examples

- $\displaystyle \operatorname{dimensions}\left(\begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{pmatrix}\right) = \left[ 2, 3 \right]$

  `dimensions([[1, 2, 3], [4, 5, 6]])`

  In the solver, `dimensions([[1, 2, 3], [4, 5, 6]])` gives `[2, 3]`.

  [Open in the solver](https://hilberon.com/?q=dimensions%28%5B%5B1%2C%202%2C%203%5D%2C%20%5B4%2C%205%2C%206%5D%5D%29)

## Related functions

- [drop](https://hilberon.com/library/drop)

  A list without its first elements.
- [count](https://hilberon.com/library/count)

  How many elements of a list equal a value.
- [first](https://hilberon.com/library/first)

  The first element of a list.
- [constant_array](https://hilberon.com/library/constant_array)

  A list of copies of a value.
- [flatten](https://hilberon.com/library/flatten)

  Nested lists flattened into one list.
- [complement](https://hilberon.com/library/complement)

  The elements of a list that are in none of the others.

---
Source: https://hilberon.com/library/dimensions
