How to transpose a block matrix

6 ビュー (過去 30 日間)
Ubaldo
Ubaldo 2016 年 10 月 27 日
コメント済み: Ubaldo 2016 年 10 月 27 日
Hi all,
How to transpose in a nice way a block matrix? Say that I have A = [A11 A12 A13;A21 A22 A23;A31 A32 A33], where each Aij is a n*m matrix, how to compute A'= [A11 A21 A31;A12 A22 A32;A13 A23 A33]?

採用された回答

Massimo Zanetti
Massimo Zanetti 2016 年 10 月 27 日
編集済み: Massimo Zanetti 2016 年 10 月 27 日
Use cells, transpose them.
C={[1,1;1,1],[2,2;2,2];[3,3;3,3],[5,5;5,5]};
D=C';
%to get matrices out of cells
cell2mat(C)
cell2mat(D)
  2 件のコメント
Ubaldo
Ubaldo 2016 年 10 月 27 日
Top!
Ubaldo
Ubaldo 2016 年 10 月 27 日
Oh, but wait one second. To properly compute the transpose I also have to transpose each single sub-matrix. For example
C={[1 2;3 4],[1 2;3 4];[9 8;7 6],[9 8;7 6]}, then the transpose of C shall be C_transp = {[1 3;2 4],[9 7;8 6];[1 3;2 4],[9 7;8 6]}

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by