Reputation: 14211
I have a vector
a = 1:4
I want to get
[4 3 2 1]
Which matlab function should I use?
Upvotes: 7
Views: 19786
Reputation: 2332
If the array you want to reverse is a range a:b
, then it is much faster to use:
-(-b:-a)
Upvotes: 0