Given n (only odd), return output matrix a that has concentric rings of the numbers 1 through (n+1)/2 around the center point.
For n = 3,
a = [2 2 2;
2 1 2;
2 2 2;]
For n = 5,
a = [3 3 3 3 3;
3 2 2 2 3;
3 2 1 2 3;
3 2 2 2 3;
3 3 3 3 3;]
Solution Stats
Problem Comments
3 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers30
Suggested Problems
-
318 Solvers
-
Who knows the last digit of pi?
689 Solvers
-
Find the position of first minimum value in an integer array with numbers
183 Solvers
-
Change the first and last diagonal element of the identity matrix to zero
158 Solvers
-
Create sequnce 1 4 9 16 25.........
413 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Looks like the test suite could use some work.
This problem has been updated and corrected.
Hi Grant, it is nice to see that your are now maintaining all Cody problems. Cheers!