A=matrix([[2,6],[3,9]])

B=matrix([[1,2],[3,4]])

C=matrix([[-5,5],[5,3]])

from sage.matrix import constructor

G=constructor.block_diagonal_matrix(A,B,C)

G

Result:

[ 2  6| 0  0| 0  0]
[ 3  9| 0  0| 0  0]
[-----+-----+-----]
[ 0  0| 1  2| 0  0]
[ 0  0| 3  4| 0  0]
[-----+-----+-----]
[ 0  0| 0  0|-5  5]
[ 0  0| 0  0| 5  3]

Pratap-2.6-4 (last edited 2010-12-17 10:37:58 by sprint_first)