Stacked Matrix Permutation

Simplify the reordering of the sub-dimensions in a stacked matrices
ダウンロード: 238
更新 2013/6/10

ライセンスの表示

When a MATLAB matrix contains submatrices related to various factors it is sometime needed to reorder them along different factors.

E.g. we have a 2D matrix where rows are organized by 141 runs each made of 8 parts. Along the columns we have 21 microphones. A training algorithm requires to merge parts and microphone, needing a 2D matrix with the 141 runs in the rows, and both parts and microphones in the columns.

The initial layout can be expressed as: (parts runs) x (mics) where the terms in parenthesis are organized as in an inverse nested loops: for the rows we first iterate by runs and then by parts. That is from inner loop to outer loops in left to right. The target layout is instead: (runs) x (parts mics)

The general problem for 2D matrices is (A B C...) x (D E F...), and the resolution relies on the fact that MATLAB stores matrices in column order, that is we can use a single flat representation as (A B C D E F) with the same ordering from inner to outer.

This function is similar to permute but it manipulates the sub-dimensions defined inside rows or columns of a given matrix.

引用

Emanuele Ruffaldi (2024). Stacked Matrix Permutation (https://www.mathworks.com/matlabcentral/fileexchange/42145-stacked-matrix-permutation), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2012b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0