Problem 412. Back to basics 22 - Rotate a matrix
Covering some basic topics I haven't seen elsewhere on Cody.
Rotate the input matrix 90 degrees counterclockwise (e.g. [1 2; 3 4] -> [2 4; 1 3]
Solution Stats
Problem Comments
-
4 Comments
Show
1 older comment
Chaya N
on 22 Oct 2016
The test suite does not like the inbuilt function . Says there are too many output arguments!
Chaya N
on 22 Oct 2016
Is there something wrong with the test suite? The assertion fails and I get the following message:
"Error using rotate Too many output arguments. Error in TestPoint1 (line 3) assert(isequal(rotate(x),y_correct))"
Aditya Jain
on 23 Oct 2016
Yes it rotate is an inbuilt MATLAB function and it overshadows this. Changed the function name to rotateBy90
Solution Comments
Show commentsProblem Recent Solvers910
Suggested Problems
-
Swap the first and last columns
20986 Solvers
-
1434 Solvers
-
304 Solvers
-
564 Solvers
-
1586 Solvers
More from this Author39
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!