A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
17
Task/Generic-swap/MATLAB/generic-swap.m
Normal file
17
Task/Generic-swap/MATLAB/generic-swap.m
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
>> a = [30 40 50 60 70]
|
||||
|
||||
a =
|
||||
|
||||
30 40 50 60 70
|
||||
|
||||
>> a([1 3]) = a([3 1]) %Single swap
|
||||
|
||||
a =
|
||||
|
||||
50 40 30 60 70
|
||||
|
||||
>> a([1 2 4 3]) = a([2 3 1 4]) %Multiple swap, a.k.a permutation.
|
||||
|
||||
a =
|
||||
|
||||
40 30 60 50 70
|
||||
Loading…
Add table
Add a link
Reference in a new issue