当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


Julia SparseArrays.blockdiag用法及代码示例


用法:

blockdiag(A...)

连接矩阵block-diagonally。目前仅针对稀疏矩阵实现。

例子

julia> blockdiag(sparse(2I, 3, 3), sparse(4I, 2, 2))
5×5 SparseMatrixCSC{Int64, Int64} with 5 stored entries:
 2  ⋅  ⋅  ⋅  ⋅
 ⋅  2  ⋅  ⋅  ⋅
 ⋅  ⋅  2  ⋅  ⋅
 ⋅  ⋅  ⋅  4  ⋅
 ⋅  ⋅  ⋅  ⋅  4

相关用法


注:本文由纯净天空筛选整理自julialang.org 大神的英文原创作品 SparseArrays.blockdiag — Function。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。