Reverses the order of an Armadillo Vector
Arguments
- x
A column vector
of length N
Value
A column vector
with its contents reversed.
Details
Consider a vector x=[1,2,3,4,5], the function would output x=[5,4,3,2,1].
Examples
x = 1:5
reverse_vec(x)
#> [,1]
#> [1,] 5
#> [2,] 4
#> [3,] 3
#> [4,] 2
#> [5,] 1