This solution together with the solution of James' (or mine) exhibits a nice duality between the "top-down" and "bottom-up" approaches.
Determine whether a vector is monotonically increasing
12203 Solvers
1316 Solvers
135 Solvers
Replace Nonzero Numbers with 1
184 Solvers
221 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!