Hi Lucy,
The point of a block-matrix is that it is composed of smaller matrices
that we keep as whole objects. If you want to flatten this to an
explicit matrix you can use as_explicit:
In [6]: sym.BlockMatrix([[a], [phi], [theta]]).as_explicit()
Out[6]:
⎡ 0 ⎤
⎢ ⎥
⎢ 0 ⎥
⎢ ⎥
⎢ 0 ⎥
⎢ ⎥
⎢φ₀₀⎥
Hi Oscar,
I am using version 1.3.
The introduction of the extra [] brackets now makes the shape 11,1.
However, when the variable is viewed it is as follows:
Matrix([
[Matrix([
[0],
[0],
[0]])],
[ phi],
[ theta]])
What I really want is a single matrix
Hi Lucy,
Running on master I get this:
In [13]: sym.BlockMatrix([[a], [phi], [theta]])
Out[13]:
⎡⎡0⎤⎤
⎢⎢ ⎥⎥
⎢⎢0⎥⎥
⎢⎢ ⎥⎥
⎢⎣0⎦⎥
⎢ ⎥
⎢ φ ⎥
⎢ ⎥
⎣ θ ⎦
In [14]: sym.BlockMatrix([[a], [phi], [theta]]).shape
Out[14]: (11, 1)
Note that I've used extra square brackets to indicate that I want
these
Hi,
I am looking to concatenate three matrices (shown below) using BlockMatrix,
however, the output has the wrong dimensions.
theta = sym.MatrixSymbol('theta', 5, 1)
phi = sym.MatrixSymbol('phi', 3, 1)
a = sym.Matrix([[0],[0],[0]])
X = sym.BlockMatrix([a, phi, theta])
With this code I get the