how do i reverse a vector
이전 댓글 표시
채택된 답변
추가 답변 (3개)
Royi Avital
2011년 6월 13일
This might work as well (For 1D Vectors):
vReversed = v(end:-1:1);
Good luck!
댓글 수: 3
Shweta Kanitkar
2013년 5월 29일
v(end:-1:1) subtracts each element from v(end) by 1.
Walter Roberson
2013년 6월 28일
Matt Eicholtz points out that Shweta's comment is incorrect; no subtraction is done, only indexing.
Cyrus David Pastelero
2020년 7월 8일
This is what I am looking for. Thank you.
Walter Roberson
2011년 6월 13일
2 개 추천
fliplr() or flipud()
... But I suspect this is a class assignment. You will need to use your knowledge of MATLAB indexing and looping to work out your assignments for yourself.
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!