Problem 43492. Create a square matrix with given conditions

Create a square matrix, M, which should be populated as follows:

 M = [ n^2      n * (n-1)    n * (n-2)  ...    n * 2    n * 1;
     (n-1)*n  (n-1)*(n-1)  (n-1)*(n-2)  ...  (n-1)*2  (n-1)*1;
     (n-2)*n  (n-2)*(n-1)  (n-2)*(n-2)  ...  (n-2)*2  (n-2)*1;
        .          .            .       .       .       .    ;
        .          .            .        .      .       .    ;
        .          .            .         .     .       .    ;
       2 * n    2 * (n-1)    2 * (n-2)  ...    2 * 2    2 * 1;
       1 * n    1 * (n-1)    1 * (n-2)  ...    1 * 2    1 * 1]

Solution Stats

54.05% Correct | 45.95% Incorrect
Last Solution submitted on Nov 20, 2024

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers106

Suggested Problems

More from this Author37

Problem Tags

Community Treasure Hunt

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

Start Hunting!