Problem 56383. Create spiral matrices
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
Dyuman Joshi
on 17 Oct 2022
Copy of #579. Spiral In
Solution Comments
Show commentsProblem Recent Solvers3
Suggested Problems
-
How to find the position of an element in a vector without using the find function
2773 Solvers
-
Create a cell array out of a struct
2253 Solvers
-
find the roots of a quadratic equation
234 Solvers
-
Find out value of sine given by degree.
344 Solvers
-
Test Problem; Create a 5x5 array containing all ones
394 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!