Shuffle a vector by breaking it up to segments of n elements, and rearranging them in a reversed order.
For example, the vector:
vector = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
should be shffuled by segments of n=3 like so:
cetvor = [8,9,10, 5,6,7, 2,3,4, 1]
The shuffled vector should have the same dimensions as the original one.
Solution Stats
Solution Comments
Show comments
Loading...
Problem Recent Solvers333
Suggested Problems
-
Project Euler: Problem 2, Sum of even Fibonacci
2838 Solvers
-
Find the sum of the elements in the "second" diagonal
1204 Solvers
-
673 Solvers
-
Replace Nonzero Numbers with 1
446 Solvers
-
Find the sides of an isosceles triangle when given its area and height from its base to apex
2147 Solvers
More from this Author25
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!