ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 22 Mar 2011 09:28:53 -0500matrix sizehttp://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 09:22:48 -0500http://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>
http://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 09:28:53 -0500http://ask.sagemath.org/question/8020/matrix-size/?answer=12220#post-id-12220