Matlab:找到产生另一个矩阵的置换矩阵

时间:2016-04-13 21:54:22

标签: algorithm matlab matrix permutation combinatorics

我试图编写MATLAB代码,这样我就可以找到矩阵的置换矩阵。

让我们考虑下面的例子。我给出了矩阵AB

A = [1 2 3;4 5 6; 7 8 9]   % is a given matrix
B = [9 7 8;3 1 2; 6 4 5]   % is a permuted version of A.

我的目标是找到矩阵L(预乘A}和R(后乘A),以便L*A*R = B

% L is an n by n (3 by 3) that re-order the rows a matrix when it pre-multiply that matrix
L = [0 0 1;1 0 0;0 1 0] 

% R is an n by n that re-order the columns of a matrix
R = [0 1 0;0 0 1;1 0 0] 

B = L*A*R 

当我知道LR时,如何找到AB

0 个答案:

没有答案