how to inverse a vector

I have a vector that is created in decresing order.
Example: v: [10; 9 ;8;7...;1]
However I nead him in increasing order, and I can'y seem to find a simple matlab command to achieve this.
Any help

 Akzeptierte Antwort

James Tursa
James Tursa am 1 Aug. 2012

1 Stimme

For reversing the elements even if they are not sorted:
v(end:-1:1)
or
flipud(v) % or use fliplr for a row vector

Weitere Antworten (1)

Matt Kindig
Matt Kindig am 1 Aug. 2012
Bearbeitet: Matt Kindig am 1 Aug. 2012

0 Stimmen

doc sort

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Hilfe-Center und File Exchange

Produkte

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by