Ask Your Question
2

matrix size

asked 14 years ago

calc314 gravatar image

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?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
5

answered 14 years ago

Mike Hansen gravatar image

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
Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 14 years ago

Seen: 17,396 times

Last updated: Mar 22 '11