Create a matrix of a given size with sequential elements spiraling inward.
For matrix height m and width n, the output should be an m-by-n matrix with elements ranging from from 1 to m*n in a rectangular spiral pattern with 1 in position (1,1) and the first 'leg' of the spiral progressing down the first column, i.e., the left column of the output has elements 1:m.
Solution Stats
Problem Comments
1 Comment
Solution Comments
Show comments
Loading...
Problem Recent Solvers5
Suggested Problems
-
Determine the number of odd integers in a vector
860 Solvers
-
Celsius to Fahrenheit converter
674 Solvers
-
Is this triangle right-angled?
6840 Solvers
-
Find the index of n in magic(n)
276 Solvers
-
Matlab Basics - Convert a row vector to a column vector
685 Solvers
More from this Author5
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Copy of #579. Spiral In