build a block matrix from matrices
조회 수: 4 (최근 30일)
이전 댓글 표시
I am trying to build a block matrix from square diagonal matrices e.g. M{1,1},M{1,2},M{2,1}, and M{2,2} and I need to transfer them to a big matrix B such that:
B=[M{1,1} M{1,2}]
[M{2,1},M{2,2}];
each M has the same dimension.. I appreciate any help..
댓글 수: 0
채택된 답변
Walter Roberson
2018년 4월 7일
B = cell2mat(M);
provided that the M are all the same size. (It will work in some other cases as well.)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!