Permute a Matrix

バージョン 1.1.0.0 (1.55 KB) 作成者: Andrey Popov
From given order of rearrangement constructs the permutation matrix P and computes B = P'*A*P
ダウンロード: 737
更新 2009/10/29

ライセンスの表示

PERMM Permutates a matrix A by given indexes by computing B = P'*A*P

B = permm(A,indx)
[B,P] = permm(A,indx)

The function applies simultaneous column and row permutation, that is by
given indexes indx = [k j m ...] the function rearranges the elements of A
so that B11=Akk, B12=Akj, ... B21 = Ajk, B22=Ajj, ...

Example
A = [11 12 13 % initial matrix
21 22 23
31 32 33]
idp = [2 3 1] % order of rearrangement
B = permm(A, idp); % rearranged matrix
% B = [22 23 21
% 32 33 31
% 12 13 11]

引用

Andrey Popov (2024). Permute a Matrix (https://www.mathworks.com/matlabcentral/fileexchange/25148-permute-a-matrix), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2006a
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersAudio I/O and Waveform Generation についてさらに検索
タグ タグを追加

Community Treasure Hunt

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

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

Implements some checks of the input variables and an easier construction of the permutation matrix.

1.0.0.0