bridgeIdGaps(OnOffI​ds, MaxGapSize, varargin)

Merge consecutive segments within a given gap.


Updated 3 Jan 2017

View License

This is a utility function to merge segments given by on- and offset ids which occur within a given gap. For example, the on-off ids
[4 5; 8 10; 14 20]
will be merged to
[4 10; 14 20]
with a gap size of 3 samples.
This function is part of a set of functions to convert between logical and number indexing in arrays:

Cite As

David J. Mack (2023). bridgeIdGaps(OnOffIds, MaxGapSize, varargin) (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R10
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Images in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes

[MOD] Vectorized the WHILE-loop. Now very fast.
[MOD] 'IsOn' is now only updated if it is also requested as output.

Fixed the input argument check, which was changed for release.

Added links.