>>> FEx
[0, 0, 0]
[0, 0, 0]
[0, 0, 0]
>>> FBx
[0, 0, 0]
[0, 0, -1]
[0, 1, 0]
>>> GEx
[0, 0, 0]
[0, 0, 1]
[0, -1, 0]
>>> GBx
[0, 0, 0]
[0, 0, 0]
[0, 0, 0]
The block matrix I want can be written
(FEx FBx)
(GEx GBx)
If the above formatted ok you should see what I want.
However, the following attempt:
Matrix(((Fex,FBx),(GEx,GBx)))
produces
Matrix((FEx,FBx),(GEx,GBx))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.6/dist-packages/sympy-0.7.1-py2.6.egg/sympy/matrices/matrices.py",
line 158, in __init__
raise TypeError("Data type not understood")
TypeError: Data type not understood
When I enter Matrix((FEx,FBx,GEx,GBx)) I get:
[0, 0, 0]
[0, 0, 0]
[0, 0, 0]
[0, 0, 0]
[0, 0, -1]
[0, 1, 0]
[0, 0, 0]
[0, 0, 1]
[0, -1, 0]
[0, 0, 0]
[0, 0, 0]
[0, 0, 0]
which is a 12 x 3 matrix.
So my question is how to create a 6 x 6 matrix in the form indicated above?
Thanks for suggestions.
Comer
In [53]: a = Matrix([[1, 2], [3, 4]])
In [54]: b = Matrix([[5, 6], [7, 8]])
In [55]: a.row_join(b)
⎡1 2 5 6⎤
⎢ ⎥
⎣3 4 7 8⎦
In [56]: a.col_join(b)
⎡1 2⎤
⎢ ⎥
⎢3 4⎥
⎢ ⎥
⎢5 6⎥
⎢ ⎥
⎣7 8⎦
There is an open issue that would add a better interface for this
(http://code.google.com/p/sympy/issues/detail?id=2221), but it remains
to be fixed. You're welcome to give it a shot! Ideally, you should be
able to build a Matrix from block elements just as easily as you can
from atomic elements.
Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To post to this group, send email to sy...@googlegroups.com.
> To unsubscribe from this group, send email to sympy+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
>