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.
Sum all integers from 1 to 2^n
8414 Solvers
Generate a vector like 1,2,2,3,3,3,4,4,4,4
3616 Solvers
Deleting an element in a matrix
325 Solvers
2773 Solvers
34 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!