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!