Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
17
Task/Generic-swap/MATLAB/generic-swap-1.m
Normal file
17
Task/Generic-swap/MATLAB/generic-swap-1.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
|
||||
9
Task/Generic-swap/MATLAB/generic-swap-2.m
Normal file
9
Task/Generic-swap/MATLAB/generic-swap-2.m
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
>> a = 12
|
||||
a = 12
|
||||
|
||||
>> b = 'foo'
|
||||
b = foo
|
||||
|
||||
>> [b, a] = deal (a, b)
|
||||
b = 12
|
||||
a = foo
|
||||
Loading…
Add table
Add a link
Reference in a new issue