blkdiag
- :
b =blkdiag(a1, a2, …)¶ Build a block diagonal matrix from the given numeric matrices.
The result has
sumof the row counts rows andsumof the column counts columns; each input occupies its own diagonal block and everything else is zero. The result is sparse if any input is. The class follows the usual concatenation rules (an integer class wins over single, which wins over double).