Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Assume there is an $n\times n$ matrix $\mathbf{A}$, that contains within it matrices $\mathbf{b}$, $\mathbf{c}$, and $\mathbf{d}$ and zeros in the format like: $\mathbf{A}=\begin{bmatrix}\mathbf{b} & \mathbf{0}\\ \mathbf{c} & \mathbf{d}\end{bmatrix}$, where $\mathbf{b}$ is $f\times f$ and the rest conform. I want to apply a simple transformation to this matrix to convert it to a $n\times (n+f)$ matrix $\mathbf{X}$ like: $\mathbf{X}=\begin{bmatrix}\mathbf{b} &\mathbf{0} &\mathbf{0}\\ \mathbf{0} & \mathbf{c} & \mathbf{d}\end{bmatrix} $ where the zeroes conform.

Basically I want to find a simple function/transformation f, such that $\mathbf{X}=f(\mathbf{A})$. In Matlab, this would be like blkdiag-ing $\mathbf{b}$ and the matrix $[\mathbf{c}\quad \mathbf{d}]$. Outside of the computer, I believe it is possible to do that with Kronecker products, but I'm not sure. I have considered several different approaches, but am wondering if there is a better way to do it.

What I considered:

  1. I could just extract what I need and make a more-or-less manual conversion.
  2. A similar approach would be creating a matrix E that is like A but with the first $f$ columns copied twice and another matrix G that is $1$ in the correct places and zero otherwise. Then taking the hadamard product of those E and G will produce X.
  3. A different approach would be if you know X, then you could multiply inv(A)*X to get a transition matrix (the first $f$ rows will be like an fxf identity matrix and zeros, but after that will have different values across all columns). This also implies you know in advance what you want to solve for, which makes it rather pointless.

Edit: I think I've found my answer. A block LU factorization helped clarify the issue (this would have allowed me to separate out the $\mathbf{b}$ and $\mathbf{d}$ matrices, but I wanted $\mathbf{c}$ and $\mathbf{d}$ together, which I don't think is possible).

I ultimately settled on separating the problem to $\begin{bmatrix}\mathbf{I} & \mathbf{0}\\ \mathbf{0} & \mathbf{0}\end{bmatrix}$ * $\mathbf{A}$ and $\begin{bmatrix}\mathbf{0} & \mathbf{0}\\ \mathbf{0} & \mathbf{I}\end{bmatrix}$ * $\mathbf{A}$ to separate out the different blocks. I should be able to perform my analysis on the blocks separately.

share|improve this question
Please ignore my previous comment. I misread. –  Mikael Öhman Nov 30 '11 at 17:18
@Mikael: For future reference: if you put your cursor just to the right of the time the comment was posted, you will see a red X, which will delete the comment. –  Zev Chonoles Nov 30 '11 at 18:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.