Tools for Processing Consecutive Repetitions in Vectors

버전 3.0.9 (12.1 KB) 작성자: Matt J
A set of functions for labeling and manipulating groups of consecutively repeating elements in a vector.
다운로드 수: 138
업데이트 날짜: 2023/1/25

라이선스 보기

This FEX submission provides some functions that are similar to MATLAB's usual findgroups() and splitapply() commands, except that they are specifically well-suited to scenarios where the groups are subsets of consecutively repeating elements in a vector.
EXAMPLE: To find the run lengths of consecutive non-zero elements in,
>> X=[0 0 4 7 6 1 3 0 0 0 1 11 3 8 0 0 47 14];
one can simply do,
>> runlengths = groupFcn(@length, X, groupTrue(X>0) )
runlengths =
5 4 2
For a more detailed description and examples, see the Examples tab.

인용 양식

Matt J (2024). Tools for Processing Consecutive Repetitions in Vectors (https://www.mathworks.com/matlabcentral/fileexchange/78008-tools-for-processing-consecutive-repetitions-in-vectors), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2020a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux

Community Treasure Hunt

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

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

Small bug fix in groupConsec.m
Only affected case when the input sequence started with 0.

3.0.8

Updates Examples.mlx to include an illustration of groupLims().

3.0.7

More documentation fixes

3.0.6

Some documentation corrections.

3.0.5

Upgraded groupReductFcn and groupReductHybrid with the capability of taking matrix-valued input.

3.0.4

Added some new functions: groupLims, groupReductFcn, and groupReductHybrid.

3.0.3

Fixed small bug in groupFcn. Error message was triggered in the case of multi-input functions.

3.0.2

Edit

3.0.1

Edit

2.0.6

Renamed group1s to groupTrue

2.0.5

Edits

2.0.4

Edits

2.0.3

Edited text and examples.

2.0.2

Small text edits

2.0.1

Small text edits

2.0.0

Added groupConsec and groupFcn

1.0.0