getOnOffIds(IsData)

Computes the start/end ids of 'true'-events in a logical vector.
27 téléchargements
Mise à jour 22 déc. 2016

Afficher la licence

This is a utility function to compute the start and end ids of 'on' events in a logical array, e.g. 00011011110 -> 4/5 & 7/10. This can be used simply for compression (e.g. if you want to store the events of some timeseries) or for further processing, where logical indexing does not seem to do the job. Although it uses FIND it is rather fast on larger 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

Citation pour cette source

David J. Mack (2024). getOnOffIds(IsData) (https://www.mathworks.com/matlabcentral/fileexchange/58983-getonoffids-isdata), MATLAB Central File Exchange. Récupéré le .

Compatibilité avec les versions de MATLAB
Créé avec R10
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Catégories
En savoir plus sur Matrix Indexing dans Help Center et MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Publié le Notes de version
1.1.0.0

[MOD] Simplified the start/end condition checks.
[MOD] Removed the checks for all-false/-true arrays and made them implicit. This sacrifices some speed in these special cases but makes the function faster in any other case.

1.0.0.0

Added links