Given a=[1 2 3 4 5], generate m=[2 1 3 4 5; 2 3 1 4 5; 2 3 4 1 5; 2 3 4 5 1; 1 3 2 4 5; 1 3 4 2 5; 1 3 4 5 2; 1 2 4 3 5; 1 2 4 5 3; 1 2 3 5 4].
28 views (last 30 days)
Show older comments
Given a=[1 2 3 4 5], generate
m=[2 1 3 4 5;
2 3 1 4 5;
2 3 4 1 5;
2 3 4 5 1;
1 3 2 4 5;
1 3 4 2 5;
1 3 4 5 2;
1 2 4 3 5;
1 2 4 5 3;
1 2 3 5 4].
What will be the Matlab code to generate 'm' from 'a'?
2 Comments
Jan
on 18 Oct 2015
Please explain the relation between the input and the output. Why are these 10 permutations chosen, and not the other ones?
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!