findRuns.m
Version 1.1.0.0 (549 Bytes) by
Richard Heitz
Returns indices of n consecutive numbers (you specify the number you want)
913 Downloads
Updated
13 Feb 2009
No License
Accepts: a vector of numbers
Returns: the indices of n consecutive numbers of your specification
For instance, if you want to find the first instance of 10 consecutive 1's in a vector,
x = findRuns(vector,10,1)
Code may not be pretty, but it works and is quite fast.
Cite As
Richard Heitz (2024). findRuns.m (https://www.mathworks.com/matlabcentral/fileexchange/22972-findruns-m), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2008b
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Programming > Classes > Define Classes > Handle Classes >
Find more on Handle Classes in Help Center and MATLAB Answers
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.