build a block matrix from matrices

조회 수: 4 (최근 30일)
SALMA ALJAWI
SALMA ALJAWI 2018년 4월 7일
댓글: SALMA ALJAWI 2018년 4월 8일
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..

채택된 답변

Walter Roberson
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.)
  댓글 수: 1
SALMA ALJAWI
SALMA ALJAWI 2018년 4월 8일
This is really helpful, thank you Walter..

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by