how to find the line number of a point in a vector
조회 수: 6 (최근 30일)
이전 댓글 표시
I have a vector i=[0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0].
What can I use to find in which line number starts and ends number 1 each time?
댓글 수: 0
채택된 답변
추가 답변 (1개)
Fangjun Jiang
2019년 9월 4일
편집: Fangjun Jiang
2019년 9월 4일
a=diff(i)
find(a==1)
find(a==-1)
adjust by 1
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 DMM에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!