For example, if n=2 (maximum value), the output matrix should be
[1 1 1 1 1;
1 2 2 2 1;
1 2 1 2 1;
1 2 2 2 1;
1 1 1 1 1]
where you go from inside to outside starting from 1 to 2(maximum value) and again move back from 2 to 1.
Solution Stats
Problem Comments
3 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers162
Suggested Problems
-
Create a cell array out of a struct
2573 Solvers
-
middleAsColumn: Return all but first and last element as a column vector
652 Solvers
-
Create a matrix X, where each column is a shifted copy of the vector v
226 Solvers
-
1030 Solvers
-
Is this is a Tic Tac Toe X Win?
536 Solvers
More from this Author10
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
You should call this a volcano matrix!
Could also be named an Atoll matrix
Thanks Ned, Richard for good suggestion. I have changed Problem Title accordingly.