This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.
This is broken: in my haste to fix a typo in my first version, I accidentally replaced the wrong 2 with a 1.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!