No License
Create a block diagonal matrix from matrices A1, A2, ..., An. Accepts both constant matrices (of class DOUBLE) and polynomial matrices (of class POL, requires Polynomial Toolbox).
>> A = [1 2]
A =
1 2
>> B = [1+2*s 3*s^2+4*s^3; 5*s^4 6*s^5+7*s^6]
B =
1 + 2s 3s^2 + 4s^3
5s^4 6s^5 + 7s^6
>> C = blockdiag(A,B)
C =
1 2 0 0
0 0 1 + 2s 3s^2 + 4s^3
0 0 5s^4 6s^5 + 7s^6
Cite As
Zdenek Hurak (2026). BLOCKDIAG (https://www.mathworks.com/matlabcentral/fileexchange/2979-blockdiag), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 | Example now includes polynomial matrices |
