【发布时间】:2016-04-13 21:54:21
【问题描述】:
我正在尝试编写 MATLAB 代码,它可以让我找到矩阵的置换矩阵。
让我们考虑下面的例子。我得到了矩阵A 和B:
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
当我知道A和B时,如何找到L和R?
【问题讨论】:
-
这很可能更适合math.stackexchange.com
标签: algorithm matlab matrix permutation combinatorics