Problem 61055. Enclosure Matrix

The problem gives you a positive integer n. You need to create a matrix consisting of n layers of natural numbers; the outermost layer contains the number n, the second layer contains n − 1, and so on, until the innermost layer contains the number 1.
For example:
n=3
y=[ 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

70.0% Correct | 30.0% Incorrect
Last Solution submitted on Nov 03, 2025

Solution Comments

Show comments

Problem Recent Solvers7

Suggested Problems

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!