I really don't see the point of that kind of problems where you can't use Matlab built-in functions.
which functions?
Return the largest number that is adjacent to a zero
3774 Solvers
489 Solvers
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
301 Solvers
449 Solvers
Spot the First Occurrence of 5
368 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!