6.45.17 Dimension of a matrix:
dim
The
dim
command finds the dimension of a matrix.
dim
takes one argument:
A
, a matrix
dim(
A
)
returns a list of the number of rows and columns of the matrix
A
.
Example.
Input:
dim([[1,2,3],[3,4,5]])
Output:
⎡
⎣
2,3
⎤
⎦