length(find((XM(2:end)>126.5 & XM(1:end-1)<126.5)| (XM(2:end)<126.5 & XM(1:end-1)>126.5)));
조회 수: 1 (최근 30일)
이전 댓글 표시
Can anyone tell me if in this function the terms XM (2: end) and XM (1: end-1) indicate two successive elements of the vector ?. If so, why? thank you in advance
댓글 수: 0
답변 (2개)
KALYAN ACHARJYA
2022년 2월 23일
편집: KALYAN ACHARJYA
2022년 2월 23일
It represent the total elements in the vector (Except First One)
XM(2:end)
It represent the total elements in the vector (Except last one)
XM(1:end-1)
Indicate two successive elements of the vector (Multiple ways)
XM(1:2)
XM(i:i+1)
XM(end-1:end)
.....
댓글 수: 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!