How to create a matrix of same entries?
For example, I want to make a 20 by 20 matrix with all entries being 10. Is there a quick command for that? Thanks!
For example, I want to make a 20 by 20 matrix with all entries being 10. Is there a quick command for that? Thanks!
This is one way.
sage: matrix(ZZ, 4, 4, lambda i, j: 10)
[10 10 10 10]
[10 10 10 10]
[10 10 10 10]
[10 10 10 10]
Thank you! This is what I was looking for.
Asked: 8 years ago
Seen: 734 times
Last updated: Nov 29 '16