Given a logical vector v, and a positive integer n, return the smallest index i that satisfies
Info
This question is closed. Reopen it to edit or answer.
Show older comments
Given a logical vector v, and a positive integer n, return the smallest index i that satisfies
all( v(i : i+n-1) ) == true
For Example,
input : v = logical([0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0]);
input : i = consecutiveFind(v, 4);
Then:
output : i = 6
Answers (1)
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!