I really don't see the point of that kind of problems where you can't use Matlab built-in functions.
which functions?
Find the longest sequence of 1's in a binary sequence.
3421 Solvers
280 Solvers
385 Solvers
262 Solvers
642 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!