BLOCKDIAG

Version 1.0.0.0 (578 Bytes) by Zdenek Hurak
Creates a block diagonal matrix.
1.4K Downloads
Updated 14 Mar 2003

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
Created with R13
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Operating on Diagonal Matrices in Help Center and MATLAB Answers
Version Published Release Notes
1.0.0.0

Example now includes polynomial matrices