The test suite is not enough because it does not contain any case that the number of consecutive true bits is exactly same as n.
This is exactly what I was looking for.
I knew strcmp gives the same functionality for char arrays, but it didn't occur to me I can simply use it for logicals and doubles.
Thanks
What is the next step in Conway's Life?
654 Solvers
Project Euler: Problem 3, Largest prime factor
398 Solvers
388 Solvers
Duplicate each element of a vector.
520 Solvers
Generate a string like abbcccddddeeeee
237 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!