Problem 2631. Flip the vector from right to left
Flip the vector from right to left.
Examples
x=[1:5], then y=[5 4 3 2 1]
x=[1 4 6], then y=[6 4 1];
Request not to use direct function.
Solution Stats
Problem Comments
-
14 Comments
Show
11 older comments
Kanishk
on 10 Nov 2022
Nice problem!
Nicolas Douillet
on 30 Nov 2022
Not using Matlab dedicated function to this should be written in the problem statements. I dislike this kind of "twist". Nonsense.
Dyuman Joshi
on 1 Dec 2022
@Nicolas, It IS written in the problem statement -
"Request not to use direct function."
Solution Comments
Show commentsProblem Recent Solvers9478
Suggested Problems
-
Remove any row in which a NaN appears
8648 Solvers
-
Find common elements in matrix rows
2665 Solvers
-
Replace NaNs with the number that appears to its left in the row.
3012 Solvers
-
Number of 1s in a binary string
9598 Solvers
-
Get the elements of diagonal and antidiagonal for any m-by-n matrix
484 Solvers
More from this Author70
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!