Given a matrix, print all its elements in the spiral form (clockwise direction).
For example,
a=[16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1]
output = [16 2 3 13 8 12 1 15 14 4 9 5 11 10 6 7]
Solution Stats
Problem Comments
3 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers15
Suggested Problems
-
Sort a list of complex numbers based on far they are from the origin.
5810 Solvers
-
How to find the position of an element in a vector without using the find function
2819 Solvers
-
Convert a numerical matrix into a cell array of strings
2514 Solvers
-
991 Solvers
-
Golomb's self-describing sequence (based on Euler 341)
190 Solvers
More from this Author174
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Asif,
I think some of the solution vectors in this problem are incorrect. In problem 2, for example, all the numbers after 120 are duplicates.
sorry about that..there was a bug in my code
It's been fixed now