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?
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?
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: 14 years ago
Seen: 17,396 times
Last updated: Mar 22 '11