I'd suggest adding test cases in which n (or abs(n)) is larger than the dimension of x; for example, x is a 4-by-4 matrix and n = 6.
72 Solvers
620 Solvers
184 Solvers
345 Solvers
Given a 4x4 matrix, swap the two middle columns
516 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!