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

 채택된 답변

James Tursa
James Tursa 2012년 8월 1일

1 개 추천

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

추가 답변 (1개)

Matt Kindig
Matt Kindig 2012년 8월 1일
편집: Matt Kindig 2012년 8월 1일

0 개 추천

doc sort

카테고리

도움말 센터File Exchange에서 Aerospace Blockset에 대해 자세히 알아보기

제품

태그

질문:

2012년 8월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by