MATLAB: Sub-Matrices in a bigger matrix

composing the matrices

Dear Users,
Imagine that I have 4 square matrices such as A11, B11, C11 and D22.
I want to insert them as diagonal elements of a bigger matrix (please see the pic on the attchments).
However, I don't know the size of the bigger matrix. I will find it out when I insert all sub-matrices. Is there any easy way to do it?
Thanks in advance!

Best Answer

blkdiag(A11, B11, C11, D22)