Please add a simple example to the Problem Statement to illustrate the method you describe in words. Please also add further tests to the Test Suite (cf. Problem 44521). Currently it is easily 'hacked', as demonstrated with Solution 1465530.
332 Solvers
Flag largest magnitude swings as they occur
588 Solvers
Reverse the elements of an array
692 Solvers
07 - Common functions and indexing 2
328 Solvers
2257 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!