Array slice indexing?
조회 수: 288 (최근 30일)
이전 댓글 표시
Hey
please explain what the following function does :
y=a(i,end:-1:1);
if you could give me an example that would be great! thank you
댓글 수: 0
답변 (2개)
the cyclist
2017년 11월 13일
편집: the cyclist
2017년 11월 13일
It returns the ith row of a, in right-to-left order.
댓글 수: 0
Mohammed Hamaidi
2022년 3월 22일
Take for example:
a=[1 2 3; 5 6 7; 8 9 12]
and
i=2
then
a(i,end:-1:1)
gives: the 2nd row in right to left order (the elements of the 2nd row from right to left)
ie: 7 6 5
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!