Transforming a array of matrices into a single large matrix with these matrices on the diagonal.
이전 댓글 표시
Hi,
I have an array of length z with different n times m matrices. Now I would like to put all these matrices on the diagonal of some large sparse matrix. If the matrices were all identical, I would simply write:
kron(speye(z,z),A)
Unfortunately, in my case they are not. So the above doesn't really work. Is there a simple elegant way to solve my problem?
Regards, Laurent
채택된 답변
추가 답변 (1개)
Walter Roberson
2011년 7월 17일
0 개 추천
댓글 수: 3
Laurent
2011년 7월 17일
Walter Roberson
2011년 7월 17일
What does it mean to say that you have an array that contains matrices? Does it mean that your array is a cell array? If so then,
blkdiag(V{:})
Jan
2011년 7월 20일
@Walter: BLKDIAG replies a sparse array if any input is sparse.
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!