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.
Make a run-length companion vector
512 Solvers
We love vectorized solutions. Problem 1 : remove the row average.
547 Solvers
Calculate the derivative of a polynomial
170 Solvers
462 Solvers
2457 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!