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.
213 Solvers
Project Euler: Problem 10, Sum of Primes
707 Solvers
148 Solvers
How many trades represent all the profit?
520 Solvers
Generate a string like abbcccddddeeeee
234 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!