Eliminate or merge the sequences
이전 댓글 표시
Hello everyone,
Using vectorization, I want to merge the sequences. Let say I have vector v with values
v = [43 43 43 33 34 35 35 43 43 43 43 43];
I want to get an other vector which should store on only
ind =[1 4 5 6 8];
The sequence should be eleminated and their index should be safed in ind.
답변 (2개)
Kelly Kearney
2015년 4월 22일
ind = [1 find(diff(v) ~= 0)+1];
Azzi Abdelmalek
2015년 4월 22일
ind=find(diff([v(1)+1 v]))
카테고리
도움말 센터 및 File Exchange에서 String에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!