A problem must detail what needs to be done in its description. There is not only one way to do what's requested. You should probably add more test cases too, at least 5, to avoid lookup table solutions.
348 Solvers
Who is the smartest MATLAB programmer?
561 Solvers
Calculate the Number of Sign Changes in a Row Vector (No Element Is Zero)
226 Solvers
387 Solvers
465 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!