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

16 Solutions

10 Solvers

Last Solution submitted on Dec 10, 2025

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers10

Suggested Problems

Problem Tags

Community Treasure Hunt

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

Start Hunting!