Search in array with sequence
이전 댓글 표시
I have array like this: y=[00110011100001110011] I need search in array, and if it is sequence [..11..] then i get 5, if it sequence [..111...] then I should get 6. In the answer I should got sequence something like this:[..5665556...] So maybe know how do that?
채택된 답변
추가 답변 (2개)
Andrei Bobrov
2013년 11월 23일
편집: Andrei Bobrov
2013년 11월 23일
out = sprintf('%d',strfind([y '0'],'10')-strfind(['0' y],'01')+4)
ADD
out = sprintf('%d',(strfind([y '0'],'10')-strfind(['0' y],'01')>3) + 5)
댓글 수: 4
Andrei Bobrov
2013년 11월 25일
What is it Masyvas? Please small example for Masyvas.
Image Analyst
2013년 11월 25일
Do you expect him to type that in? Unlikely. Please make it easy for him to help you by attaching the csv or workbook file.
Povilas
2013년 11월 26일
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!