Question: Building matrix from two vectors

Hey everyone!

I am trying to merge two vectors into a matrix. Let us say that both of the vectors has only one line and 4 columns:
A:=[a1,a2,a3];B:=[b1,b2,b3,b4];
Therefore, the matrix that I am trying to get should have this form:
M=Matrix([[a1,b1,0,0,0,0,0,0],[0,0,a2,b2,0,0,0,0],[0,0,0,0,a3,b3,0,0],[0,0,0,0,0,0,a4,b4]]);
Thanks in advance!

Please Wait...