How to change the form of a matrix?

Hi everyone,

I’m trying to change the form of a matrix to an other one. My matrix looks something like this:

I want to convert it in something that looks like this:

Using Collect and Solve, I’m able to get close to what I want but I can’t figure how to rebuild the matrix without doing something stupid. Do you have any suggestions on how I could solve this issue?

Thanks

Is it this what you are looking for?

bmix = {b1, a1, b3, a3};
amix = {a2, b2, a4, b4};
tT = Table[t[i, j], {i, 4}, {j, 4}];
tT // MatrixForm
lsg1 = Flatten[Solve[bmix == tT. amix // Thread, {b1, b2, b3, b4}]] //
    FullSimplify;
r1 = {b1, b2, b3, b4} /. lsg1;
aa = {a1, a2, a3, a4};
sM = Table[Coefficient[r1[[i]], aa[[j]]], {i, 4}, {j, 4}];
sM // MatrixForm
r1 - sM.aa // FullSimplify

It really seems to be what I needed! Thank you so much!