Effacer les filtres
Effacer les filtres

how to inverse a vector

76 vues (au cours des 30 derniers jours)
Karel
Karel le 1 Août 2012
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

Réponse acceptée

James Tursa
James Tursa le 1 Août 2012
For reversing the elements even if they are not sorted:
v(end:-1:1)
or
flipud(v) % or use fliplr for a row vector

Plus de réponses (1)

Matt Kindig
Matt Kindig le 1 Août 2012
Modifié(e) : Matt Kindig le 1 Août 2012

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by