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.
Flip the main diagonal of a matrix
506 Solvers
Generate a vector like 1,2,2,3,3,3,4,4,4,4
3624 Solvers
The Answer to Life, the Universe, and Everything
383 Solvers
228 Solvers
2877 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!