ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 22 Mar 2011 15:28:53 +0100matrix sizehttps://ask.sagemath.org/question/8020/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?Tue, 22 Mar 2011 15:22:48 +0100https://ask.sagemath.org/question/8020/matrix-size/Answer by Mike Hansen for <p>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?</p>
https://ask.sagemath.org/question/8020/matrix-size/?answer=12220#post-id-12220You 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
Tue, 22 Mar 2011 15:28:53 +0100https://ask.sagemath.org/question/8020/matrix-size/?answer=12220#post-id-12220