FINDSEQ

버전 1.7.0.0 (17.8 KB) 작성자: Oleg Komarov
Find sequences of repeated (adjacent/consecutive) numeric values. NaNs and Infs are supported.
다운로드 수: 2.2K
업데이트 날짜: 2013/11/11

라이선스 보기

Find sequences of repeated (adjacent/consecutive) numeric values. Finds sequences of NaNs and Infs too.

SYNTAXES:
(1) FINDSEQ(A) Find sequences of repeated numeric values in A along the first non-singleton dimension. A shuld be a numeric nD matrix.
(2) FINDSEQ(A,DIM) Look for sequences along the dimension specified by the positive integer scalar DIM.

OUT = findseq(...)
OUT is a "m by 4" numeric matrix where m is the number of sequences found.
Each sequence has 4 columns where:
- 1st col.: the value being repeated
- 2nd col.: the position of the first value of the sequence
- 3rd col.: the position of the last value of the sequence
- 4th col.: the length of the sequence

[VALUES, INPOS, FIPOS, LEN] = findseq(...)
Get OUT as separate outputs.

For details see help
For examples see the attached image.

Comments/suggestions/error reports are welcome.
p10v5 - Update strongly recommended due to major bug in output sorting in v4.

인용 양식

Oleg Komarov (2024). FINDSEQ (https://www.mathworks.com/matlabcentral/fileexchange/28113-findseq), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2012a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Correlation and Convolution에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.7.0.0

Fixed major bug in the sorting of Final position that relied on regularity conditions not always verified

1.6.0.0

Per Herbert Gsenger's suggestion fixed bug in matching initial and final positions; minor change to distribution of OUT if multiple outputs; added 3D example

1.4.0.0

Per Zachary Danziger's suggestion reorganized check structure to avoid bug when concatenating results

1.3.0.0

Cast double on logical instead of single when treating NaNs and Infs

1.2.0.0

Per Xiaohu's suggestion fixed bug in output dimensions when A is row vector

1.1.0.0

Reorganized code and fixed bug when concatenating results

1.0.0.0