Problem 2573. Flipping
Write code that can reverse the vector without using any sort of loop.
Example
Given the input vector
A = [ 1 2 3 4 5 6 7 8 ]
Output would be
B = [ 8 7 6 5 4 3 2 1 ]
Solution Stats
Problem Comments
-
2 Comments
Georges
on 10 Sep 2014
Your test suite is not appropriate!!!!
Ned Gulley
on 8 Oct 2014
I fixed the test and added a few tests.
Solution Comments
Show commentsProblem Recent Solvers560
Suggested Problems
-
Remove any row in which a NaN appears
8571 Solvers
-
Back to basics 22 - Rotate a matrix
897 Solvers
-
Longest run of consecutive numbers
5412 Solvers
-
725 Solvers
-
Check that number is whole number
4213 Solvers
More from this Author8
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!