How can I shuffle matrix without random matrix
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Anantachai Chotkamsri
am 5 Feb. 2022
Kommentiert: Anantachai Chotkamsri
am 5 Feb. 2022
Example :
i=6;
A=[1:i];
[1 2 3 4 5 6] n=1
[1 2 3 4 6 5] n=2
[1 2 3 5 4 6] n=3
[1 2 3 5 6 4] n=4
.
[1 3 2 4 5 6] n=24
.
[2 1 3 4 5 6] n=120
.
[6 5 4 3 2 1] n=720 ; factorial(this matrix size)
thank you
0 Kommentare
Akzeptierte Antwort
Davide Masiello
am 5 Feb. 2022
Hi, MatLab offers a built-in function that computes all the possible permutations of an array.
A = 1:6;
P = perms(A);
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!