Ask Your Question
1

matrix size

asked 2011-03-22 09:22:48 -0600

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?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
4

answered 2011-03-22 09:28:53 -0600

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
edit flag offensive delete link more

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: 2011-03-22 09:22:48 -0600

Seen: 4,659 times

Last updated: Mar 22 '11