How to construct matrix from 4 sub matrices in Matlab?

1.7k Views Asked by At

I have an 8x8 matrix defined as

$T = \begin{bmatrix}T_{UU} \quad T_{UF}\\T_{FU} \quad T_{FF}\end{bmatrix}$

I can define $T_{UU}$, $T_{UF}$, $T_{FU}$, and $T_{FF}$ as

TFU = T(5:8,1:4)
TFF = T(5:8,5:8)
TUU = T(1:4,1:4)
TUF = T(1:4,5:8)

Is there a nice way to build the following matrixes in Matlab or Octave?

$K1 = \begin{bmatrix}0 \quad -T_{UF}\\-I \quad -T_{FF}\end{bmatrix}$

and

$K2 = \begin{bmatrix}I \quad -T_{UU}\\0 \quad -T_{FU}\end{bmatrix}$

where I is an Identity matrix.

1

There are 1 best solutions below

0
On BEST ANSWER

Matlab is pretty good with block matrices like this. You can do

K1 = [zeros(4,4),-TUF; -eye(4), -TFF];