フィルターのクリア

Permutation Matrix on Matlab

48 ビュー (過去 30 日間)
Zafer Sahin
Zafer Sahin 2021 年 10 月 9 日
編集済み: Zafer Sahin 2022 年 5 月 5 日
Hi I am new on MATLAB. In my project I am using matlab. Some step of works wanted to find permuation matrix. AS you can see from photo given.
So I need to find permutation matrix for A(sc). But I couldn't figure out how to make on MATLAB. I use below codes, it gives irrevalent result. T
A=[-1 -1 1;1 -1 0;-3 0 1;1 0 0]
B = perms(A);

採用された回答

Walter Roberson
Walter Roberson 2021 年 10 月 9 日
The description showed you the way:
ASc = [-1 -1 1;1 -1 0;-3 0 1;1 0 0]
ASc = 4×3
-1 -1 1 1 -1 0 -3 0 1 1 0 0
[LSc, USc, PSc] = lu(ASc)
LSc = 4×3
1.0000 0 0 -0.3333 1.0000 0 0.3333 1.0000 1.0000 -0.3333 0 1.0000
USc = 3×3
-3.0000 0 1.0000 0 -1.0000 0.3333 0 0 0.3333
PSc = 4×4
0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 1
Note: the term "permutation matrix" in this context is not the same as is produced by perms() https://www.mathworks.com/help/matlab/ref/perms.html which "returns a matrix containing all permutations of the elements of vector v in reverse lexicographic order." The concepts do have a relationship, but perms() is not at all what you want for the purpose of building the kind of permutation matrix you need.

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by