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
Problem Comments
-
1 Comment
Dyuman Joshi
on 28 Dec 2025 at 12:39
@BuiHoangSon -
This question has been asked many times already.
Given the repetetive nature and limited test cases of this problem, this problem will be deleted shortly, unless the test suite is updated to make the problem different than the rest.
Solution Comments
Show commentsProblem Recent Solvers10
Suggested Problems
-
10 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!