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.
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.
nice!this is the easiest way to translate to another language.
550 Solvers
522 Solvers
244 Solvers
Back to basics 25 - Valid variable names
253 Solvers
Duplicate each element of a vector.
455 Solvers