This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.
It's like a lesson. logical indices don't have to be full size! And for will apparently loop through a vector! Thanks!
Bonus! Vector doesn't have to be monotonic!
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!