1、blkdiag函数:生成指定对角线元素的矩阵
2、用法说明
A = blkdiag(a,b,c,d,...) 函数产生以a,b,c,d,...为对角线元素的矩阵A
3、举例说明
>> x = blkdiag(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16)
x =
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 6 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 7 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 8 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 9 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 10 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 11 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 12 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 13 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 14 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 16
4、附录
>> help blkdiag
blkdiag Block diagonal concatenation of matrix input arguments.
|A 0 .. 0|
Y = blkdiag(A,B,...) produces |0 B .. 0|
|0 0 .. |
Class support for inputs:
float: double, single
See also diag, horzcat, vertcat
Overloaded methods:
InputOutputModel/blkdiag
Reference page in Help browser
doc blkdiag