# matrix size

I am writing a function that may take a matrix of varying size as an input. What is the command for finding the dimensions of a matrix in Sage?

matrix size

add a comment

4

You can get the dimensions with the `nrows`

and `ncols`

methods:

```
sage: m
[0 0 0]
[0 0 0]
sage: m.nrows()
2
sage: m.ncols()
3
```

Asked: **
2011-03-22 09:22:48 -0600
**

Seen: **8,146 times**

Last updated: **Mar 22 '11**

Given a value and conditions, find a matrix with that value as its determinant

Generate a Matrix over a Finite Field with symbolic variables

Smith-McMillan Form of a polynomial matrix

Can I use the block_matrix command to create arbitrary sizes of block matrix arrays?

Matrix Group over Symbolic Ring

Get a matrix to display answers as decimals/floats, not fraction?

Matrix multiplication of sparse matrix with matrix over polynomial ring

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.