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 Solvers159
Suggested Problems
-
Find the peak 3n+1 sequence value
2568 Solvers
-
Project Euler: Problem 1, Multiples of 3 and 5
3680 Solvers
-
Natural numbers in string form
1864 Solvers
-
Return fibonacci sequence do not use loop and condition
855 Solvers
-
Convert from Fahrenheit to Celsius
28049 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.