| 1 | initial version |
To construct a matrix of matrices:
sage: a = random_matrix(QQ, 2, 2)
sage: b = random_matrix(QQ, 2, 2)
sage: c = random_matrix(QQ, 2, 2)
sage: d = random_matrix(QQ, 2, 2)
sage: v = matrix([[a,b,c,d]])
It prints horribly (but view(v) looks good).
sage: a
[ 2 0]
[ 1 1/2]
sage: b
[ 0 -1]
[1/2 2]
sage: c
[ 2 1]
[ 2 -2]
sage: d
[ -1 1/2]
[1/2 1]
sage: v
[[ 2 0]
[ 1 1/2] [ 0 -1]
[1/2 2] [ 2 1]
[ 2 -2] [ -1 1/2]
[1/2 1]]
sage: v.nrows()
1
sage: v.ncols()
4
sage: v.base_ring()
Full MatrixSpace of 2 by 2 dense matrices over Rational Field
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.