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

17 Solutions

11 Solvers

Last Solution submitted on Feb 26, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers11

Suggested Problems

Problem Tags

Community Treasure Hunt

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

Start Hunting!