Problem 1671. Generate the Matrix!

Given n, generate the following matrix:

a = [ n  n-1 n-2 ... 2 1;
     n-1 n-1 n-2 ... 2 1;
     n-2 n-2 n-2 ... 2 1;
      .   .   .   .  . .;
      .   .   .   .  . .;
      .   .   .   .  . .;
      2   2   2  ... 2 1;
      1   1   1  ... 1 1]

Good luck!

Solution Stats

49.47% Correct | 50.53% Incorrect
Last Solution submitted on Jul 06, 2023

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers122

Suggested Problems

Community Treasure Hunt

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

Start Hunting!