onoffids2logical(on​OffIds, varargin)

Convert start and end ids of events to logical indicator array.
Aktualisiert 27 Apr 2017

Lizenz anzeigen

This is a utility function to compute a logical indicator array from the start and end ids of events in an array, e.g. 4/5 & 7/10 -> 00011011110. This is can be used quickly extract the events by logical indexing. It is vectorized and thus is very fast even for large arrays.
This function is part of a set of functions to convert between logical and number indexing in arrays:
GETONOFFIDS: www.mathworks.com/matlabcentral/fileexchange/58983
ONOFF2LOGICAL: www.mathworks.com/matlabcentral/fileexchange/58984
BRIDGEIDGAPS: www.mathworks.com/matlabcentral/fileexchange/58985

Zitieren als

David J. Mack (2024). onoffids2logical(onOffIds, varargin) (https://www.mathworks.com/matlabcentral/fileexchange/58984-onoffids2logical-onoffids-varargin), MATLAB Central File Exchange. Abgerufen .

Kompatibilität der MATLAB-Version
Erstellt mit R10
Kompatibel mit allen Versionen
Windows macOS Linux
Mehr zu Numeric Types finden Sie in Help Center und MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Veröffentlicht Versionshinweise

- [ADD] Error check for onOffIds outside of prespecified n.
- [FIX] Disappearing single sample events.

2016-12-16 (DJM): [FIX] Removed enlarging 'IsOn' in case the last sample is contained in 'OnOffIds'.

Added links.