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.
1813 Solvers
239 Solvers
Output any real number that is neither positive nor negative
319 Solvers
447 Solvers
492 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!