Since Cody, I dislike for-loops, but your solution is way simpler than my own algorithm. Mission accomplished...
Nevertheless, I would hope for a non-looped piece of code. Let's see in phase 3.
Get the area codes from a list of phone numbers
532 Solvers
Back to basics 25 - Valid variable names
293 Solvers
Permute diagonal and antidiagonal
224 Solvers
188 Solvers
291 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!